Keyboard Maestro Macro - Search UID in TheArchive from any application
A thing that I miss when I'm not emacs with
zetteldeft is the hotkey which allows for searching whatever UID is under the cursor with
deft. So, I tried to replicate it in Keyboard Maestro. It (attempts to) select the current word, then uses the Archive url format to search for that word. Conveniently, if you write your uids like
201911162040 they are a word.
A couple of notes:
- There doesn't seem to be any way to select text by way of regex or the like in KM. I am selecting text by emulating alt-rightarrow and then shift-alt-leftarrow. This has worked so far in everything I've tried but it seems brittle. Alternate approaches here are welcome.
- When you are working within The Archive, this also seems to be a mostly functional temporary replacement for a hotkey to "click on" a UID in TheArchive, which I think @ctietze mentioned wanting to implement at some point.
- I am using the
thearchive://match/TERMurl format. This should work just as well with
thearchive://search/TERMbut supply slightly different results. I'm still playing around to figure out which I like better but it's easy to change that in the macro.
- If you take out the first three steps of the macro, it will work on whatever is in your clipboard. This may be more useful, depending on your workflow.
- As a bonus, this macro will also search The Archive for whatever word is under your cursor in any other app. Maybe that's good? I could see it being useful if you want to see if you've written about something, or as another way of picking random zetteln.
- This is the first time I've tried to share a macro, so, let me know if I did anything unfortunate.
Feedback welcome, and Enjoy!
It looks like you're new here. If you want to get involved, click one of these buttons!