I am happy with an AppleScript in a Drafts action (see below) that creates a Note for me. I can run it on a single draft or multiple drafts just fine.
What I wish to do, now, is have this action run automatically (I can schedule running in Keyboard Maestro, for example)…
Against all drafts in the inbox…
Finding only drafts with a certain tag
Why? Drafts on my Apple Watch is the best way for me to capture text, but I ultimately want these to go to my Notes app. Fewer manual steps are preferred, thus my request for help with the automation part.
Can anyone help?
Thank you,
John
on execute(draft)
set theText to ""
set theText to content of the draft
tell application "Notes"
set Note_Body to "<pre style=\"font-family:System Font;font-size:14px;\">" & theText & "</pre>"
tell account "iCloud"
make new note at folder "Notes" with properties {body:Note_Body}
delay 2
end tell
end tell
end execute
You could trigger opening a URL in Keyboard Maestro that will run the action.
You could trigger your desired selection through additional key strokes sent from Keyboard Maestro to Drafts, or you could expand upon your action (utilising JavaScript) to work over the desired set. The latter would forego the usual timing challenges and be more robust in my opinion.