【发布时间】:2014-11-18 23:31:10
【问题描述】:
我正在尝试将文件和目录从一个名为“Motion Templates”的目录复制到另一个名为“Motion Templates”的目录。
tell application "Finder"
set srcPath to ((parent of (path to me) as text) & "Motion Templates")
set dstPath to (((path to movies folder) as text) & "Motion Templates")
set srcFolder to folder srcPath
set dstFolder to folder dstPath
duplicate entire contents of srcFolder to dstFolder with replacing
end tell
源目录 (Motion Templates) 包含一个子目录 (Generators),它根据匹配的文件路径成功复制到目标“Motion Templates”(从源“Motion Templates/Generators”到目标“Motion Templates/发电机”)。但是,此脚本也会删除“Motion Templates/Generators”中存在的所有现有子目录。如何在不删除树中其他现有文件的情况下复制/覆盖文件?
【问题讨论】:
标签: file automation applescript