Set Up Evernote Short Term To-Do (Actions) List

Submitted here for others' use and review. If you see a more elegant way to accomplish what I've done here please let me know.

I have two Evernote documents that I use every day: "Inbox/Sweep" and "Actions." Inbox/Sweep is where I dump all of my thoughts, and Actions is where I line them up for completion in the next few days. Inbox/Sweep is a bulleted list, but I like actions to be formatted with bold headers for X Morning, X Afternoon, and X evening, with a bullet below each.

I made a macro to set up my Actions in this way, and then move the cursor to its starting position underneath the first Morning header. I make the bullets in Evernote because if I paste them in from KM, Evernote does not create a second bullet after hitting Return from KM's bullet.

Actions Setup.kmmacros (9.3 KB)

Hey Christian,

You can do that much more efficiently by creating the necessary HTML and emplacing it with AppleScript.

Run this from the Script Editor.app to test.

It will operate on the SELECTED note and DESTROY any other contents.

------------------------------------------------------------
set htmlContent to "<div id=\"en-note\"><div><b>Sunday Morning</b></div><ul><li><br /></li></ul><div><br /></div><div><b>Sunday Afternoon</b></div><ul><li><br /></li></ul><div><br /></div><div><b>Sunday Evening</b></div><ul><li><br /></li></ul><div><br /></div><div><b>Monday Morning</b></div><ul><li><br /></li></ul><div><br /></div><div><b>Monday Afternoon</b></div><ul><li><br /></li></ul><div><br /></div><div><b>Monday Evening</b></div><ul><li><br /></li></ul></div>"

tell application "Evernote"
  set enSel to selection
  set enNote to item 1 of enSel
  tell enNote
    set HTML content to htmlContent
  end tell
end tell
------------------------------------------------------------

A specific note or a new note could be targeted instead.

-Chris

Yes that is more efficient! Is there a way to vary the headers in AppleScript like I’d done with %ICUDateTime%EEEE%? I like that I can fire it on any day and get today’s and tomorrow’s setup. Eventually I’d like to vary it based on time, too.

Hey Christian,

Sure.

Create the HTML on the fly, and put it into a Keyboard Maestro variable.

Call the variable from AppleScript like this:

---------------------------------------------------------------------
# Keyboard Maestro — Get value of variable "<variable name>"
---------------------------------------------------------------------
tell application "Keyboard Maestro Engine"
  set kmVariableName to "kmVariableName"
  if variable kmVariableName exists then
    set myAppleScriptValue to value of variable kmVariableName
  else
    error "Variable '" & kmVariableName & "' does not exist!"
  end if
end tell
---------------------------------------------------------------------

Alternatively you could create the HTML inside the AppleScript.

-Chris

Thank you. I am trying to put this into use. :slight_smile:

Hey Christian,

Holler at me if you get stuck.

-Chris