You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

AppleScript/Finder无法检测到Applications文件夹中的Numbers应用

问题原因分析

你的AppleScript脚本找不到Numbers应用,核心原因是路径名称不匹配:

  • macOS里的应用本质是后缀为.app的包文件夹,终端命令里明确显示实际存在的是/Applications/Numbers.app/;
  • 但你的脚本中拼接的路径是AppFolder & "Numbers",相当于查找名为Numbers的对象,而非实际存在的Numbers.app,Finder自然会判定该对象不存在。
修正后的脚本示例

可以直接指定完整的应用包名称来检查:

tell application "Finder"
  set NumExists to exists folder "Numbers.app" in folder "Applications" in startup disk
end tell

或者更简洁的写法,直接针对应用文件类型检查:

tell application "Finder"
  set NumExists to exists application file "Numbers.app" in folder "Applications"
end tell

内容的提问来源于stack exchange,提问作者Philip Kearns

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 00:50:55