AppleScriptTask throwing an error 5 - invalid proc

2019-06-03 16:20发布

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

2条回答
迷人小祖宗
2楼-- · 2019-06-03 16:31

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.

查看更多
狗以群分
3楼-- · 2019-06-03 16:44

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

查看更多
登录 后发表回答