Apple Script files are an easy way to Automate repetitive Macintosh tasks. You can use Script Editor to write your own Script and save it as a file anywhere on you Mac. In order to assign a keyboard Shortcut, you need a way in which you can assign a configurable Keyboard Shortcut to any existing Apple Script File. This post provides a quick way to Bind a keyboard Shortcut to any Apple Script File and run it instantly or at a later date / time.
The very first step is to use Script Editor (Launch it from Launchpad or any other location) and create your Apple Script File. Once you have written code for your Script, save it on your Mac. The given below screenshot displays an Apple Script File stored on Desktop.
Once you have created your Apple Script file, download and install the Auto Mouse Click Application. This 3rd party Software Application is a try before buy Software Application and provides it’s own Actions to create Scripts. You can read more about it on the Automation Software for Mac post which presents it’s features and displays lots of Screenshots. The next step is to create another Script with an Action to Execute Apple Script file as displayed in the screenshot below.
Note in the above Screenshot that the Keyboard Shortcut F6 has been assigned to execute a Macro Script. This Macro Script has one Action to Execute Apple Script file with extension .scpt Adding an Action to Execute Apple Script file can be done using the Add button and then to select the Apple Script File, simply double click on the newly added Action as defined in the screenshot below.
Using this method to Assign Keyboard Shortcut to Apple Script files opens up whole new world of Macintosh Automation for you. Yes there are lots of other Automation Actions which you can add to the new Script with the help of Macro Editor or Auto Mouse Click Application. You can even schedule the Macro to Execute at a later date / time or you can even loop the Macro to execute multiple times and thereby executing Apple Script as and when required. The Keyboard Shortcut assigned in this demonstration is a single function key, however you can bind any other Keyboard Shortcut to execute the Macro Script containing Apple Script Execution and other Actions.