I'm new to Keyboard Maestro and so I'm sharing this macro for feedback, and in case anyone might find it useful.
I use NVAlt as a hub to my notes, organising them in Dropbox, but also syncing to Simplenote (not sure why these days…). While NVAlt is akin to my notes database, I don't like starting new notes in NVAlt, and prefer to start them in BBEdit.
I wrote this macro to simplify saving a new file as a note in the style where the note title begins as the first line (à la Simplenote), but ultimately is saved as the file name on disk.
I have this macro mapped to ⌘S since I often save new files as notes. The AppleScript determines whether the file is on disk. If it is, it exits, and KBM triggers the normal BBEdit 'Save' menu. If it is not, it saves the text of the first line, then prompts whether to save as a note or normal file.
In the case of a note, first an AppleScript deletes the first two lines of the file, then KBM triggers the 'Save As…' menu item, types a ~ to get the Go To panel. It enters the Notes folder of my Dropbox, then sets the name of the file to the first line/title with a .txt extension. The user is then left to press the final 'Save' button.
Any feedback would be greatly appreciated; there's still tons left for me to learn with Keyboard Maestro. Cheers.
Save Note.kmmacros (10.5 KB)