移动内容:无法获取路径的全部内容

时间:2016-09-26 19:00:27

标签: macos applescript

我只是试图将我的路径内容从一个目录移动到另一个目录,但我一直收到错误,我不确定我做错了什么。任何帮助将不胜感激。

brew install postgres

1 个答案:

答案 0 :(得分:1)

假设~/Movies/M Templates已经存在,并且您想要将其他文件复制到其中而不是仅仅完全替换它:

set src to path to me
set dst to path to movies folder

tell application "Finder"
  duplicate items of folder "M Templates" of parent of src ¬
      to folder "M Templates" of dst with replacing
end tell

(如果希望Finder自动覆盖任何现有项目,请使用duplicate...with replacing。)

或者,复制M Templates文件夹,替换之前的任何文件夹:

set src to path to me
set dst to path to movies folder

tell application "Finder"
  duplicate folder "M Templates" of parent of src to dst with replacing
end tell