How do not open databases that were open last time

The only way in which it doesn’t work happens to be the most frequent way that I kill DTPO: By pressing Q while holding down Command-Tab to kill applications one after the other at the end of each night.

KM does work if I select DTPO, make it active, and then it it’s own Command-Q.

But that’s exactly the sort of process which KM makes easier, isn’t it? I think there’s a Quit All Applications macro which you may find helps. It will also simplify your current workflow (all those Qs…) See this blog post: https://ldstephens.net/2017/08/24/tip-quickly-quit-all-open-applications-at-once-on-your-mac-keyboard-maestro/

Actions can be chained, so your eventual ‘Good Night’ macro could with a single key stroke close all your DTP databases, then close all open applications.

I’m in between installations at the moment (High Sierra is being configured and I haven’t reinstalled KM yet…) so I can’t test, but chaining the following should get you close:

Activate: Devonthink
Show or Select Menu Item: Devonthink > File > Databases > Close all databases (or whatever)
Pause: for X seconds (to give them a chance to close properly - test to find how long you need)
Close All Applications.

Hey, nice idea, thank you.

John

Good luck!

I’m only just starting to explore what Keyboard Maestro can do beyond the basics and I’m very impressed with its capabilities.

If you haven’t already, look at the ability to make ‘Palettes’ – they’re basically a way of rolling your own menus either globally or for a certain application. For example, I have a few for DTPO: one (on opt-d) for New Document commands, one (on opt-s) for general scripts and so on.

So if I want to create a new Markdown document with a custom CSS header and certain tags, all I do is opt-d m. (I’ve set the menu to disappear after the second key stroke.)

The beauty of this is: you don’t have to remember all the shortcuts, because they are in front of you on the menu AND you don’t have to worry about running out of shortcuts, because the menu shortcut is only valid in that application (opt-s is my standard 'bring up this application’s scripts palette in them all) and the individual shortcuts are only valid while the menu is up.

The macros can also be synced automatically between my laptop and desktop so I don’t have to recreate them. It’s so useful that I almost never use System Preferences for shortcuts any more.