用AppleScript遍历文件夹文件
(2022-03-14 11:17:20)
标签:
applescriptiteratorfolderalias |
分类: 计算机与 Internet |
tell application "Finder"
set curFolder to folder of the front window
set curFolderPath to quoted form of POSIX path of (curFolder
as alias)
tell application "Terminal"
set curTab to do script ("cd
" & curFolderPath)
end tell
set curFiles to files of curFolder
repeat with curFile in curFiles
set curFilePath to quoted form of POSIX path of (curFile as
alias)
tell application "Terminal"
do script ("file " &
curFilePath & " | grep -L \"for
architecture arm64\"") in curTab
repeat until curTab is not busy
end repeat
end tell
end repeat
end tell
注意这里 (as alias)一定要加,否则报错。