I am brand new to AppleScript and I’ve been reading as much as I can, but I’m having trouble following much of what I read because the only way I know to make a code run is to press the ‘Run’ button in the Script Editor.
What I’m trying to do is use AppleScript in lieu of VBA in Excel 2004 because excel doesn’t seem to like talking to things like Mail and Safari - not to mention I would like the code to continue working when the new version of Office comes out.
Is there a way to call AppleScript by pressing a button in excel, in the way that you would link a Macro to the button? OR - what other method is there to call the script without the user having to go out of their way to do so?
This seems like a helpful response but I am also new to Mac computers and AppleScript. I have opened the utility and from there I set up the actions for the folder to reflect Microsoft Office 2004 and in the select the script. Still, I cannot seem to figure out how to get Excel to interact with the script that I have written.
I know I may sound a bit vague but is there a step that I am missing?
You can’t actually call a AppleScript from Excel. What you can do though is create a AppleScript that you manually call yourself which then interacts with Excel in someway. If you search around here you will find some Excel scripts or post some more information on the task you are trying to accomplish.
I’m also having to make the transition from VBA to AppleScript. In Excel 2008, if you look to the right of the Help menu, there is a little AppleScript symbol. Pull that down and you will see “About this menu…” It explains how to add a script to this menu. There is a button called “Open Folder” at the bottom left of this explanation. Click on that, pull your script into the folder that opens and your Script will show up in this AppleScript menu the next time you pull it down. Then select your script from the menu and it will run. Simple. Alternatively, you can use a program such as QuicKeys to trigger the scripts by key combinations. Currently, there is no way to link an AppleScript directly to a cell, but that may come in time.