如果我有一个这样的applescript片段
tell application "Finder"
set thePath to (POSIX path of (path to application "MyApp"))
end tell
它会回到我身边
“/应用程序/MyApp.app”
现在,我似乎无法弄清楚如何通过变量而不是文字来指定“MyApp”。
我的 applescript 读取了一些 XML 值,其中之一是我感兴趣的应用程序的名称。我试过这个:
tell application "Finder"
set thePath to (POSIX path of (path to application someVariable))
end tell
但这只是告诉我错误
“Finder 出错:无法将应用程序“MyApp”转换为类型常量。”
任何想法我怎么能做到这一点?