Wolfram mathematica 为什么我的Applescript在终端上使用osascript在雪豹上运行,而不是在狮子上运行?

Wolfram mathematica 为什么我的Applescript在终端上使用osascript在雪豹上运行,而不是在狮子上运行?,wolfram-mathematica,applescript,osascript,Wolfram Mathematica,Applescript,Osascript,我有下面的Applescript,它在Applescript编辑器中运行良好,包括雪豹和狮子。我还可以通过终端在雪豹上使用osascript运行它,但不能在狮子上运行。代码如下 tell application "System Events" try get process "Mathematica" on error -- Not running, launch and run launch application "Mathematica" -- May need t

我有下面的Applescript,它在Applescript编辑器中运行良好,包括雪豹和狮子。我还可以通过终端在雪豹上使用osascript运行它,但不能在狮子上运行。代码如下

tell application "System Events"
try
    get process "Mathematica"
on error -- Not running, launch and run
    launch application "Mathematica"
    -- May need to wait until application finishes launching
    repeat while "Mathematica" is not in name of processes
        delay 0.5
    end repeat
end try
end tell
tell application "Mathematica"
activate
do script "notebook0=NotebookEvaluate[\"/Users/me/file.nb\"];
           Clear[notebook0];NotebookClose[EvaluationNotebook[]]"
end tell
该脚本打开并执行Mathematica脚本。对于上面的场景,它是成功的,但是当我尝试在Lion中使用osascript运行它时,我得到一个Mathematica窗口,该窗口声明“无法找到或访问请求的文件”


非常感谢您的帮助。

当您启动应用程序“Mathematica”时,我建议您提供应用程序的完整路径