Yes, it is awesome.
When you save an AppleScript as a regular script, it has to be launched from a Script menu.
In this case, we're wanting a global keyboard shortcut assigned to it. The script then needs to be launched by another process.
If you're not already using a 3rd party launcher software like Quicksilver/Alfred/etc, then the best bet is to use Automator and save a script as a Service. Then it can be assigned a global keyboard shortcut.
Basic steps are:
1. Create a service using Automator
- Launch Automator (usually found within your Applications folder)
- Go to File > New
- Select Service and click Choose
- In the top right hand of the window that appears, ensure that "No input" is selected from the Service receives drop-down list
- The In drop-down list can show "Any application" but you can change it to "Accordance"
- In the column containing the long list of actions, find or search for "Run AppleScript" and double-click on it or drag it to the right
- This will add the Run AppleScript window on the right
- Now, replace the (* Your script goes here *) with the script you want: tell application "System Events" to tell process "acord" to click button "Info Pane" of toolbar 1 of window 1
- Save the service using a meaningful name (e.g. Accord-Info Pane Toggle).
Now to the next step.
2. Creating your shortcut
- Go to System Preferences > Keyboard > Shortcuts
- Select Services from the sidebar
- Find your new service
- Add a shortcut by double clicking on the service name
Permissions are tricky when using UI scripting tricks like this simple script does. You will have to adjust System Security Permissions the first time it runs.
- In System Preferences > Security & Privacy > Privacy
- Select Accessibility in the sidebar
- Click on the + sign (you may need to unlock the padlock if it's locked)
- Add Automator.
- You may also need to add Finder which is found in /System/Library/CoreServices/Finder.app. The problem is that whatever launches the script needs to be added to the permisssions. Apple understandably makes it very hard for a script to have permission to take over all the controls of the windows showing.
This is all a huge workaround to try and fix a missing app keyboard shortcut.