AppleScriptTask 抛出错误 5 - 无效的过程调用或参数

AppleScriptTask 抛出错误 5 - 无效的过程调用或参数

问题描述:

我在 Mac 2016 Powerpoint 上遇到了问题.在我的 VBA 模块中,我需要运行一个 applescript.由于我们不能再使用 MacScript,我按照 RonDeBruin 的解释使用 AppleScriptTask.我的 Applescript 自己运行良好,但是当我尝试这样称呼它时:

I'm facing a problem on Mac 2016 Powerpoint. In my VBA module I need to run an applescript. As we cannot use MacScript anymore I followed RonDeBruin's explanation to use AppleScriptTask. My Applescript is working fine on his own but when I try to call it like this :

AppleScriptTask("hello.scpt", "myhandler", "hello")

在我的苹果脚本中

on myhandler(paramString)
say paramString
End myhandler

它给了我一个错误 5 - 无效的过程调用或参数

It gives me an error 5 - Invalid procedure call or argument

我的脚本放在 Library/Application Scripts/com.microsoft.Powerpoint 这个路径可以吗?

my script is placed in Library/Application Scripts/com.microsoft.Powerpoint is this path alright?

感谢您的帮助

我知道这是一个旧线程,但我收到了这个错误,问题是我的 AppleScript 的位置.

I know this is an old thread but I was receiving this error and the issue was the location of my AppleScript.

我最初把它放在下面/Library/Application Scripts/com.microsoft.Excel我应该把它放在我的图书馆里/Users/username/Library/Application Scripts/com.microsoft.Excel

I originally had it under /Library/Application Scripts/com.microsoft.Excel and I should have had it under my Library /Users/username/Library/Application Scripts/com.microsoft.Excel