如何创建 Automator 工作流、服务或文件夹操作以使用 ditto。此处的目的是使用 ditto 合并文件夹和/或文件,避免 Finder 用新文件夹/文件替换旧文件夹/文件的不可接受行为。
答案1
创建一个服务接收文件夹在发现者. 添加单个运行 AppleScript使用以下脚本代码对其执行操作:
on run {input, parameters}
set dest to choose folder with prompt "Select destination:"
set dest_path to (POSIX path of dest) as text
set src_paths to ""
repeat with idx from 1 to count (input)
set src_paths to src_paths & (quoted form of (POSIX path of item idx of input as text)) & " "
end repeat
set cmd to "ditto " & src_paths & quoted form of dest_path
do shell script cmd
end run
脚本将执行
ditto selectedFolder1 selectedFolder2 selectedFolderN folderChosenInDialog
分配键盘快捷键以方便访问系统偏好设置 » 键盘 » 键盘快捷键 » 服务。