Applescript - 简单的脚本来批量拍摄文件夹

时间:2013-05-23 15:58:32

标签: automation applescript osx-mountain-lion

我需要一个简单的通用脚本[适用于在finder中打开的文件夹],它将从文件夹中提取所有文件,同时保持文件夹处于活动状态。

IE中。我有10个文件夹,每个文件夹里面有1个文件。 运行脚本ID后,就像在同一个地方有10个文件和10个空文件夹。

我尝试了一些AppleScript,但不知何故失败了:(

2 个答案:

答案 0 :(得分:0)

尝试:

set mainFolder to (choose folder)
tell application "Finder"
    set theFiles to files of (entire contents of mainFolder)
    move theFiles to mainFolder
end tell

答案 1 :(得分:0)

您也可以使用mv或find:

cd ~/Folder; mv */* .
cd ~/Folder; find . -type f -exec mv {} . \;