finnmatti 3 Posted March 28, 2020 Share Posted March 28, 2020 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 Download the macros (see below) Import the Macros to Keyboard Maestro 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 Run the collector macro (be patient: the first time might take a while…) 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. 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 Download Evernote Note Autocomplete Macros.kmmacros My blog post introducing this macro. 1 Link to comment
Level 5* DTLow 5,744 Posted March 28, 2020 Level 5* Share Posted March 28, 2020 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
finnmatti 3 Posted March 29, 2020 Author Share Posted March 29, 2020 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. 1 Link to comment
Level 5* DTLow 5,744 Posted March 29, 2020 Level 5* Share Posted March 29, 2020 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
finnmatti 3 Posted March 29, 2020 Author Share Posted March 29, 2020 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now