AppleScript 通过右键单击复制并粘贴文件
抱歉,我没有更多的基础,但我对 AppleScript 一无所知。基本上我想右键单击一个文件或文件夹并运行一个脚本,将其复制到具有恒定目录结构的新位置。显然,脚本编写已经很糟糕了,但是像这样的..
path = /Volumes/RENDERS/ThisShow/ThisShot/ThisShow_ThisShot_v10/
newPath = from 'path' ReplaceText("/Volumes/RENDERS/" , "/Volumes/Raid-Renders /")
告诉应用程序“Finder”将文件“path”复制到“newPath”并替换
在此示例中,“path”将是正确的文件或文件夹启动脚本时单击。本示例中的新文件夹为“/Volumes/Raid-Renders/ThisShow/ThisShot/ThisShow_ThisShot_v10/”。所以想法是它将“ThisShow_ThisShot_v10”文件夹及其内容复制到“/Volumes/Raid-Renders/ThisShow/ThisShot/”
感谢您的帮助。我知道这里没什么可做的。
Sorry I don't have more of a foundation but I know nothing of AppleScript. Basically I want to right-click on a file or folder and run a script that will copy it to a new location with a constant directory structure. So obviously the scripting is way off, but something like this..
path = /Volumes/RENDERS/ThisShow/ThisShot/ThisShow_ThisShot_v10/
newPath = from 'path' ReplaceText("/Volumes/RENDERS/" , "/Volumes/Raid-Renders/")
tell application "Finder" to duplicate file 'path' to 'newPath' with replacing
In this example "path" would be the file or folder that was right clicked on when launching the script. The new folder in this example would be "/Volumes/Raid-Renders/ThisShow/ThisShot/ThisShow_ThisShot_v10/". So the idea is that it would copy "ThisShow_ThisShot_v10" folder and its content to "/Volumes/Raid-Renders/ThisShow/ThisShot/"
Thanks for any help. I know there isn't a lot to go on here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可以做到:
据我所知,您不能将 AppleScript 分配给右键单击菜单。但是,您可以创建菜单栏脚本。为此,请首先将此脚本另存为本地
Library
文件夹的Scripts
文件夹中的常规脚本文件。如果您的主菜单栏中(位于屏幕顶部)有一个看起来像卷轴的小图标(以前称为
脚本菜单
),则脚本应该出现在该菜单中的某个位置。如果您没有看到该图标,请运行AppleScript Utility
(位于/Applications/AppleScript/AppleScript Utility
)并选中在菜单栏中显示脚本菜单< /代码> 复选框。
现在,运行脚本所需要做的就是打开脚本菜单,找到您的脚本,然后单击它一次。问题?问。 :)
This should do it:
As far as I know, you can't assign an AppleScript to a right-click menu. However, you can create a menu bar script. To do this, first save this script as a regular script file in the
Scripts
folder of the localLibrary
folder.If you have a little icon in your main menubar (located at the top of the screen) that looks like a scroll (formerly known as the
Script Menu
), the script should appear somewhere in that menu. If you don't see the icon, runAppleScript Utility
(located at/Applications/AppleScript/AppleScript Utility
) and check theShow Script Menu in menu bar
checkbox.Now, all you have to do to run the script is open up the Script Menu, find your script, and just click on it once. Questions? Ask. :)