Automation Applescript-用于批量从文件夹中拍摄照片的简单脚本

Automation Applescript-用于批量从文件夹中拍摄照片的简单脚本,automation,applescript,osx-mountain-lion,Automation,Applescript,Osx Mountain Lion,我需要一个简单的通用脚本[在finder中打开的文件夹上工作],它将从文件夹中提取所有文件,同时保持文件夹的活动状态 我有10个文件夹,每个文件夹里面有一个文件运行脚本id后,希望在同一位置有10个文件和10个空文件夹。 我尝试了一些applescript,但不知怎么失败了:(尝试: set mainFolder to (choose folder) tell application "Finder" set theFiles to files of (entire contents o

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

我有10个文件夹,每个文件夹里面有一个文件运行脚本id后,希望在同一位置有10个文件和10个空文件夹。

我尝试了一些applescript,但不知怎么失败了:(

尝试:

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

您也可以使用mv或查找:

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