加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

用AppleScript遍历文件夹文件

(2022-03-14 11:17:20)
标签:

applescript

iterator

folder

alias

分类: 计算机与 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)一定要加,否则报错。

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有