PDA

View Full Version : AppleScriptTask will not run



croydon
05-12-2022, 07:00 AM
I am trying to get an Excel spreadsheet developed in Windows to work on a Mac. I have included two AppleScriptTasks that check that files exist and send emails. On the Mac on which I'm working, these perform successfully. However on a colleague's Mac, he gets a Run-time error '5 Invalid procedure call or argument' each time. Everything looks similar on both. The only difference I can see is that on my Mac, in System Preferences | Security & Privacy | Automation, the box on the right contains 'Microsoft Excel' and 'System Events' (ticked). Would this be the reason that the AppleScriptTasks won't work? If so, I can't see how to add Excel on his Automation tab. Any thoughts would be appreciated.

croydon
05-16-2022, 03:04 AM
Does anybody else use AppleScriptTask in Excel? If so, do you have Excel listed in System Preferences | Security & Privacy | Automation ? Then I can at least see if this may be the cause of my problem or whether I need to look elsewhere. Thanks.

Aussiebear
05-16-2022, 03:57 AM
I haven't heard others talking about using apple script. That's not to say that someone may happen along with experience

mansky
04-30-2023, 10:20 AM
I use AppleScriptTask to call my Apple scripts in Word. In addition to Automation, I'd check SystemPreferences/Security&Privacy/FullDiskAccess to see if Excel is listed but greyed-out. If so, click it to activate Excel to have Full Disk Access.

Also, check that the Apple scripts are in the User's ~/Library/Application Scripts/com.microsoft.Excel bundle where Excel will look for the scripts by default.