Applescript - 文件到文件夹

Applescript - files to folder

我正在寻找一种方法来解析多个文件夹以将所有文件移动到一个新文件夹中,然后使用第二个脚本来使用 applescript 将手动选择的文件移动到一个新文件夹中。

要移动文件夹中的所有文件,甚至是子文件夹中的文件,请使用此...

set parseFolder to choose folder with prompt "Choose the folder to parse"
set destinationFolder to choose folder with prompt "Choose the destination folder"

tell application "Finder"
    set foundFiles to files of entire contents of parseFolder
    move foundFiles to destinationFolder
end tell

要移动选定的文件,请使用此...

set destinationFolder to choose folder with prompt "Choose the destination folder"

tell application "Finder"
    set selectedFiles to the selection
    move selectedFiles to destinationFolder
end tell

我希望这向您展示了 applescript 是多么简单,并激励您开始学习更多。如果您想学习,可以去 here 试试 "Tutorials for beginning scripters"。

祝你好运。