How to add keyboard shortcut to Applescript

t I cannot seem to figure this out

I’m sure this is really easy, bI have a script that I have located here:
(/Users/jeff/Library/Application Support/DEVONthink Pro 2/Scripts/Move Items.scpt)

How do I attach a keyboard shortcut?

One way is to add an App specific shortcut in System Preferences > Keyboard > Shortcuts > App Shortcuts. You must use the exact menu item name.

I’ve tried that trick but it just beeps. I’m not sure what to call the actual menu bar “menu”

According to your original post, it would be Move Items

1 Like

Thanks, I needed a prompt to slow down and check the spelling . . . .

No problem. We all need a little slow down at times.

Another method – specific to DEVONthink – is to change the script name from this


Move Items.scpt

to this (for example)


Move Items___Cmd-Alt-Shift-B.scpt

You can use any combination of Cmd, Alt, Ctrl, Shift and a key (just one). That is preceded by three underscores – three (it’s important).

I use Keyboard Maestro to set these keyboard short cuts.

In KM, you set the trigger to a keyboard combination, then add a step to execute an AppleScript. I cut and paste the AppleScript into the window.

Another trick, is that you can move the applescripts around within the folder itself and this will change how they show up when you click on the menu bar icon. So “Add to Omnifocus” is one of my most used ones. I opened the folder itself, moved that script out of the Reminders folder and now it sits below the AppleScript folders when I click on the icon.

Question- Is there a way to add an individual AppleScript to the tool bar in DTPO?

Thanks!

Yes, it’s been posted here several times in the past.

  • Quit DEVONthink
  • Save the compiled script to ~/Library/Application Support/DEVONthink Pro 2/Scripts/Toolbar/
  • Launch DEVONthink
  • Open View > Customize Toolbar
  • Scroll to the bottom of the Drag your favorite items… panel
  • Drag the script the the toolbar

If you gave the script file a custom icon using Finder > Get Info, then that icon will appear as the Toolbar icon for that script.

Remember, this is your friend for using the forum.

I also use KM with DTPO and everything else… I don’t paste the AppleScript into a macro, but point to the .scpt file within the action.

I keep all my DTPO scripts in the iCloud ScriptEditor folder, then have a KM Pop Up menu to select them (with shortcuts for each script). So for example, my Annotate with RTF script is just opt-s then r. As the scripts are in iCloud and KM can sync macros across computers using Dropbox, I never have to recreate my shortcuts for a new computer / installation – the shortcuts just work – and I never have to remember to transfer any updates from one computer to another. Saves a lot of setting up time.

(BTW, I learnt this and most of the little I know about AppleScript and using it with KM and DTPO from users on this forum like Frederiko and korm and Greg. Thanks!)