Applescript 将每个 file/folder 复制到新创建的文件夹中

Applescript to copy each file/folder into new created folder

我有一个 Applescript 可以自动将文件从一个目录复制到另一个目的地。因为我是 Apple Script 的新手,所以在将 file/folder 复制到新创建的文件夹时遇到问题。

因为我的脚本是这样的

set dt to (current date) as Unicode text 

tell application "Finder"
  make new folder at alias "Macintosh HD:Users:XYZ:" with properties {name:dt}
  //In above code, new folder create automatically with system date and time on specified location like Tuesday, October 1, 2015 at 12/02/48 PM
  copy folder "Macintosh HD:Users:XYZ:Desktop:ABC:" to folder "Macintosh HD:Users:XYZ:"
  //In above code, I am facing issue that I am not able to copy file into created newly system date and time folder. How can I copy folder into newly created system date and time folder?
end tell

谁能帮帮我吗?

提前致谢。

首先,复制项目的Finder命令是duplicate

make new folder returns 对新文件夹的引用。使用此引用作为目的地。

set dt to (current date) as Unicode text 

tell application "Finder"
  set newFolder to make new folder at alias "Macintosh HD:Users:XYZ:" with properties {name:dt}
  duplicate folder "Macintosh HD:Users:XYZ:Desktop:ABC:" to newFolder
end tell