I just put together a couple of handy Keyboard Maestro macros that I thought other users of this forum might find useful. I’m using KM, but anything that can assign a hotkey to run an applescript would work. It’s very simple, and very useful:
set appName to "Notes"
tell application "System Events"
if visible of application process appName is true then
set visible of application process appName to false
else
set visible of application process appName to true
tell application process appName to set frontmost to true
end if
end tell
I have one for Notes, and one for Terminal. The trick is to do a little setup beforehand and have the note or Terminal window (or what have you) open and in the spot you want it when you start running this script. For me, I’ve got a note named “Scratchpad” that I have open, the main Notes window closed, and the window set to float on top of everything else. Now when I hit the hotkey ⌘⌥⌃N
the note appears and my keyboard focus moves to the window, ready to type. Then I hit the same hotkey to toggle it off and return to my previous window. Same for the Terminal.
Might be interesting to expand on this a bit, maybe setup an automated daily note, not sure, there are lots of options here.