我想做一个循环脚本,将父文件夹,并找到所有的子文件夹。这样,我可以一次拿一个,然后在其上运行第二个脚本。查找和列出所有子文件夹,但没有别的
这将工作,如果我在寻找文本文件。我想尝试使用它来查找文件夹,但不知道如何在该方向上找不到任何内容。
-- Search for Subfolder
set ParentPath to choose folder
set allFiles to (do shell script "find " & quoted form of POSIX path of ParentPath & " -iname \"*.eps\""))
-- Process files
repeat with nFile in allFiles
my runScript(nFile)
end repeat
理论上会是这样。
-- Search for Subfolder
set ParentPath to choose folder
set allFiles to all folders inside ParentPath
-- Process files
repeat with nFile in allFiles
my runScript(nFile)
end repeat
谢谢!
我在applescript写这个。这将如何被格式化成一个do shell脚本? –
@Tim Joe所以你的意思是你想通过applescript实现这个? – Nancy
正确。没有formillar,但我知道这将是一个do shell脚本(“find”./ -type d) –