简体   繁体   English

使用 AppleScript 将 finder 中的副本替换为脚本

[英]Replace copy in finder with script using AppleScript

I have folder mounted using gcsfuse, and copying folders using finder is too slow, so i use gsutils in a bash script, is it possible to replace the default copy action in this folder using an AppleSctipt that runs my script?我使用 gcsfuse 安装了文件夹,使用 finder 复制文件夹太慢了,所以我在 bash 脚本中使用 gsutils,是否可以使用运行我的脚本的 AppleSctipt 替换此文件夹中的默认复制操作? So if i drag a folder to this mounted folder it would copy using the script instead of the normal way.因此,如果我将一个文件夹拖到这个安装的文件夹中,它将使用脚本而不是正常方式进行复制。

You can call the bash script from AppleScript and call this using "Folder Actions" on, for example, adding a file to the folder.您可以从 AppleScript 调用 bash 脚本,并使用“文件夹操作”来调用它,例如,将文件添加到文件夹。

All the details you need are here:您需要的所有详细信息都在这里:

https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/WatchFolders.html https://developer.apple.com/library/archive/documentation/LanguagesUtilities/Conceptual/MacAutomationScriptingGuide/WatchFolders.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM