我正在尝试处理Applescript中的许多文件。这包括搬家
每个文件到工作目录进行处理
当我的脚本执行时
tell application "Finder"
move file to workdir
end tell
它总是会发出声音(就像使用finder GUI dos移动文件一样)
我该如何预防?该脚本可能会运行多个小时,并且该脚本不断发出叮叮声会令人不安。我无法完全关闭声音,因为其他事情可能需要提醒我
最佳答案
由于您在OP中明确声明“我无法完全关闭声音,因为其他事情可能需要提醒我”,因此建议您使用系统事件的磁盘文件夹文件套件中的move
命令,因为它不会使使用此方法的任何声音。
move v : Move disk item(s) to a new location.
move disk item : The disk item(s) to be moved.
to location specifier : The new location for the disk item(s).
→ disk item
示例:
set thisItem to "/path/to/disk item"
set thisFolder to "/path/to/folder"
tell application "System Events"
move disk item thisItem to thisFolder
end tell
关于audio - applescript:使用Finder move 文件时避免声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48484949/