Jump to content

An autocompletion helper for notes based on Applescript and KeyboardMaestro


Recommended Posts

Similar to my autocomplete macro for tags, this macro provides a convenient way to insert inline links to other notes.

You'll need Keyboard Maestro for this.

Setup/Usage

  1. Download the macros (see below)
  2. Import the Macros to Keyboard Maestro
  3. Configure a hot key trigger for the selector macro and (for example) a hotkey trigger for the collector macro (although other triggers would work, too) - I use 'ctrl' + 'alt' + 'cmd' + '+' and 'ctrl' + 'alt' + 'cmd' + 'shift' + '+', respectively
  4. Run the collector macro (be patient: the first time might take a while…)
  5. You're all set! Now just type your hot key trigger for the selector macro, search for a note, press return and the macro will do the rest.
  6. Run the collector macro periodically to ensure that the newest notes are included. Subsequent runs should be fast, since we only collect new notes since the last run

How it looks

sJVm18m.gif

Download

Evernote Note Autocomplete Macros.kmmacros

My blog post introducing this macro.

  • Thanks 1
Link to comment
  • Level 5*
1 hour ago, finnmatti said:

this macro provides a convenient way to insert inline links to other notes.

I'm not a KM user so I couldn't view the macro    
I am interested in seeing the applescript code

Link to comment
tell application "Keyboard Maestro Engine" to set NotesLastRun to getvariable "NotesLastRun"

tell application "Evernote"
	set noteList to {}
	set noteSearch to find notes "created:" & NotesLastRun
	repeat with thisNote in noteSearch
		set nLink to note link of thisNote
		set nTitle to title of thisNote
		copy {nLink, nTitle} to the end of noteList
	end repeat
	return noteList
end tell

There you go. As you can see: It doesn't do anything too crazy. :)  Most of the Parsing, etc. is done in KeyboardMaestro.

  • Thanks 1
Link to comment
  • Level 5*
6 hours ago, finnmatti said:

There you go. As you can see: It doesn't do anything too crazy. :)  Most of the Parsing, etc. is done in KeyboardMaestro.

Thanks, I see you're extracting all note titles/links from the Evernote database, and storing them externally
To retrieve and insert the link you search the external store

Does this scale well - I have over 14k notes?

Link to comment

The first run can take a couple of minutes to tell you the truth. But subsequent runs only ever retrieve posts created after the last run and therefore will take mere (milli)seconds...

EDIT: Right now we use the internal state management of Keyboard Maestro, but it would be rather trivial to safe and retrieve to/from a textfile or - with a little bit more work - from a database. So scaling shouldn’t be an issue. I have around 5000 Notes in Evernote at the moment and have seen no problems with the current approach. 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...