【发布时间】:2009-08-01 03:58:01
【问题描述】:
如果我有这样的applescript sn-p
tell application "Finder"
set thePath to (POSIX path of (path to application "MyApp"))
end tell
它会回到我身边
"/Applications/MyApp.app"
现在,我似乎无法弄清楚如何通过变量而不是文字来指定“MyApp”。
我的 applescript 读入了一些 XML 值,其中之一是我感兴趣的应用程序的名称。我试过这个:
tell application "Finder"
set thePath to (POSIX path of (path to application someVariable))
end tell
但这只是告诉我错误
“Finder 出错:无法将应用程序“MyApp”转换为类型常量。”
有什么想法可以做到这一点吗?
【问题讨论】:
标签: applescript