Feature Request: automatic completion when adding link to zettel
I will be typing along, and realize I want to link to an extant zettel. I have to go to the search field, search, copy the link for the relevant target, clear the search field, find the note I was working on originally, find my place in it, and paste the link. This is a lot of cognitive overhead and always takes me out of the flow.
Nearly every time I use The Archive I miss this feature from @rene 's work. In sublime-zk or sublimeless, I can type [[
while writing and get a pop-up list of all zetteln, which narrows as I type. Then, when I hit return, the correct one is inserted.
The [[
trigger is not necessary, a hotkey to bring up an auto-narrowing list would also work. In emacs with zetteldeft
I can do the same thing with a hotkey, and that works fine as well.
Honestly, this is the number one thing that makes me minimize The Archive and open another app.
Howdy, Stranger!
Comments
I completely agree with @mediapathic that this feature would be great, and I would like to see a design solution in which, when one types a character like [ or #, and continues to write a letter directly after this, a list like the following pops up.
Keyboard Maestro to the rescue!
The Archive Macros
Four macros. The first is triggered by [[ then it does a type ahead search of your notes. Then it places the UID within [[ ]]. The other three are for duplicating the same funtionality with tags. Refresh Tag Varible keeps tract of tags. Refresh Tag Cloud creates a "Tag Cloud" note and finally, Insert Tag is activated by typing the # key with the same type ahead search.
Thanks for the inspiration to create these. I'm finding them very helpful already.
I'm really an amateur at this Keyboard Maestro but I'm enjoying it so far.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
Oh no.
I mean, uh, thank you!
Thanks, I consider Keyboard Maestro in this use case a crutch till @ctietze's further developments.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
Hey Will... I just wanted to thank you for sharing your macros. I've been banging my head against the Keyboard Maestro wiki trying to figure out how to do these things. The macros you've put together helped me immensely (both in terms of getting my stuff done and in terms of learning a bit more how to bend KM to my will).
Thank you. Credit is shared amongst my teachers and those who inspired me. @kaidoh, @onlyskin, several people for the Keyboard Maestro users forum. And everyone who was kind enough to share tips on Regex. Testers and onlookers. Special thanks to @ctietze for creating this forum and The Archive. Thanks to all of you.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
@Will Sorry for my ignorance but I was only able to get Inline Note Link to work. Are there a few common stumbling blocks in Keyboard Maestro you may be able to identify and help me overcome? I have changed the filepath from yours to mine; that was easy enough to get Inline Note Link working.
@nickmilo22, glad you could get the _Inline Note Link _ working. Is there a specific macro you are trying to get to work? I'll try and help.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
@nickmilo22, glad you could get the _Inline Note Link _ working. Is there a specific macro you are trying to get to work? I'll try and help.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
Thanks @will . I think some of this is more than a few steps beyond my level of programming at the moment. I'm going to punt for the time being until I level up a bit.
Hi @Will -
I've been using both your tag and zettel autocomplete KM macros and am a huge fan. My only complaint is that I'd like a smoother way of creating new tags and zettels. In action, when hit # and type a tag that does not yet exist in the list, it would be great if I could hit simply hit return and insert "# + what I've typed in the 'Prompt with List' dialog" at my cursor location. I've been trying and can't figure it out. Any ideas?
Thanks-
I ask in Keyboard Maestro's forum about this and consensus there isn't a way to add a tag on the fly. Once you have discovered that a new tag is needed, a double tap on the esc key will end the macro and place the cursor for the new tag.
My tag strategy is such that I don't have many (maybe 30) and am reluctant to create more. Still, haven't found a use case for tagging. Tagging, as a level of zettel grouping, feels good though.
A far a smoother way of creating zettels. I'm not sure what you are asking. I use a KM template to create zettels.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
@scook, I did discover a workflow that might help with creating a new tag while using the "Insert Tag" KM.
Add a unique tag like
--Create-New-Item--
or similar that would sort at the top of the tag list. Also, set the "Default:" in the KM Action to "-". Now when run you will see the list of tags to choose from (type-ahead search still works) and if you feel the need to create a new one select--Create-New-Item--
. Still not ideal but maybe a little smoother.Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
@will, yes, I had thought of something similar. The trick there is that you'd need to know in advance that you were going to create a new tag. For me, one of the most useful functions of your autocomplete macro is that it suggests options as I type, eliminating the possibility of creating slightly different but redundant tags.
Another possibility I tried was to tigger another macro that records what I into the "Prompt with List" dialog to a variable when the autocomplete macro initiates. Using and If/Then action, I would have that recorded text variable inserted at the cursor location if the "Prompt with List" fails (by hitting escape, or something). Sadly, I couldn't get it to work.
Thanks for the feedback!
Instead of creating a new thread, I'm concatenating to this one. I hope that is ok. I basically want to second what has been said already, but also to extend the request for generic tag auto-completion.
I'm really missing this feature or rather some kind auto-tag-suggestion. When initially tagging Zettels in my preamble I have to check all instances for conformance. For if I fail to do so, the Zettel of course won't show up with applied filters although I would want it to.
It'd be great if TheArchive would grep all # or [[ - initiated strings, store them in a separate file and generate suggestions from them if one types # or [[. Perhaps with some CoreData/ UserDefaults integration and filter predicate magic.
A quick search presented me with this blog post. While (of course..) it is for iOS, it may yield some functional insight on how to do it.
Thanks!~
-edit
Maybe the complete(_:) method can be modified to that end?. Here's another possibly helpful source via this stack overflow question. And another, possibly directly pertaining to the problem; suggests to use
textView(_:completions:forPartialWordRange:indexOfSelectedItem:)
.@zeitlings Not sure I understand your request but you might check out this discussion. This creates a zettel that is basically a tag cloud, a listing of previously used tags.
Bits of help preventing minor spelling or syntax multiples and will jog the memory. (Looks pretty to.)
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
@Will thanks for your reply.
Compare it to the built-in MacOS tagging feature in Finder. When assigning tags, you start with typing a letter and as you are typing on, you will be presented with a list of previously used tags relative to the prefix you've already been entering.
As for how I imagine this to work with TheArchive, you can compare it to most IDEs, e.g. Sublime Text. Once you've defined a variable in your code, you will be presented with an in-line dropdown of already defined variables once you start typing, similar to what you've started typing.
While this would be a more convenient overview of available tags, it would still require me to manually check some tags either before I add them to the preamble or after I'd like TheArchive to be "smart" about it 🙄
I just discovered a Keyboard Maestro macro to do just that. That's nice, but, well, Keyboard Maestro. I guess I could convert this to an Alfred workflow 🤷♂️
I have decided to go all in on The Archive with KM enhancements. That said, the autocompletion of tags with look ahead has me flummoxed. It works great for tags already in the files. I have two problems, however:
How do you do headers #, ##, ### etc. Every time I try to do a header, it pulls up the tags list. When I escape out of the tags list macro, it puts me in the document, without the #. When I try again, the whole thing repeats. The escape does not seem to temporarily disable the macro. Double [ESC] as mentioned does not seem to do right either. Double escape exists the macro (first [ESC]) and clears the omni bar (second [ESC]).
Creating new tags is also a problem. @Will suggests doing the double [ESC] to exit the macro and go to the document to insert the new tag. For me Double [ESC] does as noted above. If I do one [ESC] to get out of the macro, and then do the # for the new tag, I am once more in the cycle noted above.
Any insights greatly appreciated. I know it must be something simple. both of these problems would be solved if I use a hot key instead of the string trigger. Is that the solution?
Thanks - BWB
The principal reason that I migrated from The Archive to Drafts was the friction involved with creating titles, filenames, links, and tags. I'm a big fan of Keyboard Maestro and was intrigued by the excellent macros created by @will. But, Drafts also works on my iPhone and iPad as well as on my iMac. Keyboard Maestro, unfortunately, does not. Moreover, KM is an extra purchase and requires more than a minimal commitment to learning how it works, even if someone like @will does the heavy lifting.
Drafts eliminates most of the problems that are discussed in this thread.
All of the above is done using built-in Drafts functionality or Actions that make use of the extensive scripting capability provided by Drafts. Fortunately, you don't have to know JavaScript to use them. I am a parasite -- I make use of the Actions created by others. If you are good at JSA, then the options are pretty much unlimited. If you are not, there are hundreds of Actions created by others to choose from.
Of course you can still use Keyboard Maestro on a Mac. KM macros are not available on iOS devices, but changes made to drafts using KM sync across iCloud. Similarly, if you are on an iOS device you can make use of Shortcuts. Unsurprisingly, Drafts provides lots of app-specific actions available for use with Shortcuts. Again, any changes made to a draft (or multiple drafts) will sync through iCloud.
The friction I experienced with managing notes on my iMac using TA is no longer an issue for me. Moreover, the processing options that open with iOS devices are tremendous. I'd much rather read a book sitting in a recliner using my iPhone to jot down (or dictate) notes. If something occurs to me while walking the dog, I tap on the Drafts complication on my Watch and dictate the beginnings of a note that will end up in a ZK. I can review a note on my iPhone will standing in line to check out at the grocery store. I can easily sit outside on a nice day and work using my iPad.
Much as I appreciate everything I learned while using The Archive, at this point I don't think its functionality is competitive with Drafts. And, the Drafts development/release cycle is much faster.
I was about to end this posting when I opened the Drafts Community forum and found a new posting from a Drafts user that I quote below. It provides a flavor for the activity within the Drafts community - new options are created almost faster than you can evaluate them and, if you wish, incorporate them into your workflows. To understand this post it is important to know that Drafts provides extensive interactions with many applications and services including Mail, Messages, Reminders, OmniFocus, Things, Fantastical, OneNote, Dropbox and many more. It is great for a ZK, but that is the tip of a very large iceberg. The post...
UPDATED two of these Actions to work with the new [[wiki style]] linking and added a new action to find drafts by title. These actions help you work with links between drafts and ease interaction with other applications.
Would love your feedback
@BWB I use a hotkey trigger of ⌘3 which is similar to but not the same the as ⇧3 that produces the header markdown #, ##, ###. The key command for the macro is different from the key command for a "#", so I have no problem with markdown headers. Double [ESC] was never meant to "temporarily disable the macro". It just returns you to the note so you can create the new tag manually. After the macro refreshes itself the new tag becomes available for selection.
I'm not a big fan of tags. I have a few I use to gather notes for writing projects, as my inbox, and keep my hub notes together for quick reference when adding new notes. Most of my tagging efforts go unused so I use them less and less.
Switch your trigger to a different hotkey and your issues will be solved. Be sure you are using [Shift]3 for the "#" symbol and the [Command]3 for the hotkey for tag insertion.
Will Simpson
My zettelkasten is for my ideas, not the ideas of others. I don’t want to waste my time tinkering with my ZK; I’d rather dive into the work itself. My peak cognition is behind me. One day soon, I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
@Will thanks. I set up the hot key as suggested and works like a charm. Part of my problem was a perception that I could use a string trigger, which is not the case. Thanks for the assist.