AppleScriptTask throwing an error 5 - invalid procedure call or argument

南笙酒味 提交于 2019-12-22 14:59:51

问题


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")

With in my apple script

on myhandler(paramString)
say paramString
End myhandler

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

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

Thank you for your help


回答1:


I did get that error originally but now it works for me with your stated folder location but only after I rebooted my Mac and tried the same script with Excel:mac 2016 (I'm not sure which action is responsible for the success). Interestingly, I thought that since Microsoft is very protective of their trademarks that I originally thought that the folder name needed to be "com.microsoft.PowerPoint" but that did't work.




回答2:


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

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



来源:https://stackoverflow.com/questions/35200331/applescripttask-throwing-an-error-5-invalid-procedure-call-or-argument

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!