Getting started with scripts

I saw an email this morning about summer fest which had a tip for versioning documents. I haven’t much explored DEVONthink scripts or smart rules or any of that stuff, so I thought this might be a good time to get started. I visited the extras tab, clicked “Scripts”, and I guess installed a few before realizing that nothing I clicked in that display ran any scripts. In particular, a script named “Open in Two Windows” caught my eye, so let me use that for an example.

I clicked the highlighted text which seemed to do something, though it didn’t open anything in two windows. My next thought given the text itself (viz., Edit > Open in Two Windows.scptd) made me think I should find a new option to execute the script on the edit menu, but I didn’t. So my next stop was the manual. After reading DT 3.9 documentation p. 198, I was fairly convinced everything there was classified as “internal scripts”, and it was clear from p.202 that I could edit them using the Apple Script Editor if I’d like.

The one thing I was missing was the one thing I most wanted to know: how do I run that script?! Eventually I simply opened the folder and ran it using the Apple Script Editor, but I guess when you call a script internal, I rather expect it to be inside DEVONthink and not require an external tool. Am I missing the obvious here somehow? Does anyone have tips for getting started with scripts? Thanks!

Use the script icon in the menu bar
or the toolbar

Getting more advanced, script icons can be placed in the toolbar
For example, my custom Process-Inbox script above
image

1 Like

Aside from what @DTLow has said, you can set up a keyboard shortcut for certain scripts that you run often, in one of the following ways:

  • Add the combination Name of ScriptShift+F10 in System Settings > Keyboard > Keyboard Shortcuts > App Shortcuts
  • Change name of the script file from Name of Script to Name of Script___Shift+F10
  • Use a third party tool
1 Like

Interesting. I don’t have a script icon in the menu bar. I’ve never customized it, so maybe I can add it. As to the script icon up in the system menu, thanks, that’s exactly what I was hoping to find–something like it anyway. Interestingly enough, I have two different scripts listed there under the “Edit” category:

  1. Open in two windows DT3
  2. Open in two windows

Only the latter works. I’m not sure why. I’m guessing this whole script icon is something baked into macOS of which I wasn’t aware, so thanks for bringing that to my attention.

In DEVONthink, you have to have the Script menu. It’s not an optional menu but a core component. It’s to the right of the Window menu.

Sorry, I guess I should have said the “icon bar” or “toolbar” or something like that. I don’t have a script icon on the row of pictures at the top of the DEVONthink window as indicated by DTLow’s first illustration. I do have it in the system menu bar at the top.

You can customize the Toolbar via a Control-click or View > Customize Toolbar.