Zettelkasten Forum


TOC Navigate Headers

edited March 2021 in The Archive

I have created a five-minute video demo of a Keyboard Maestro macro of an idea stolen from Zettelr. It displays a TOC for the user to select and jump to the headers in a document. Some may find it useful. Some users will think it's shit.

I created this in a fit of procrastination. I was supposed to be writing my midterm critical essay for my uni class. Really I think it only provided 30 mins of relief. But I held back until spring break to release it to you. This new area of 'indirectional' play for me is Good and Bad Procrastination.

Five-minute YouTube tour
Warning, don't drink anything while watching this. You may snort any liquid in your mouth through your nose in a fit of explosive hysteria.

Keyboard Maestro macro - TOC Navigate Headers

Thanks, @ctietze, for your suggestions that made this macro more elegant.

Post edited by Will on

Will Simpson
I must keep doing my best even though I'm a failure. 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

Comments

  • Really clever. I mean: Really. Clever.

    I am a Zettler

  • edited March 2021

    I never would've thought of using the text search feature to get to the headings. This approach deserves much applause. This also makes it super simple to replicate with other apps like TextEdit even!

    @Will I took the liberty to fix a typo in the YouTube URL so the video would display right away.

    Author at Zettelkasten.de • https://christiantietze.de/

  • Wow. LOVE this. Thanks Will for sharing your work and taking the time to make the video. The macro works great!

  • Nice video @Will , thank you.
    I'm still in doubt between Keyboard Maestro and Text Expander.
    I think that Keyboard Maestro doesn't have a mobile App, that is mandatory since I work a lot on my iPad and iPhone.

  • Thank you again for your kind words. @IvanFerrero.
    Keyboard Maestro doesn't have a mobile app. If mobile is mandatory you'll have to skip it along with The Archive.
    Keyboard Maestro and Text Expander are not equivalent apps.

    Will Simpson
    I must keep doing my best even though I'm a failure. 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 said:
    Keyboard Maestro doesn't have a mobile app. If mobile is mandatory you'll have to skip it along with The Archive.
    Keyboard Maestro and Text Expander are not equivalent apps.

    Agreed. Keyboard Maestro and Text Expander serve different purposes.
    I'll have a look at both.
    Thank you again!

  • Dear @Will ,

    thank you for being such an awesome and valuable contributor to this community - inspired by your latest video ("Atomizing Efficient Notetaking"), i installed your Keyboard Maestro TOC macro - but i can't make it work.

    The only value i need to change in the macro is the path to my Zettelkasten , is that right? I added a screenshot of the only part i changed - the path location to my Zettelkasten. Or is the syntax wrong and i missed to add any "%" characters to the path name?

    When the hotkey is triggered, nothing happens unfortunately, no prompt pops up.
    (triggered within a note with several #, ## and/or ### sections, so it should catch the sections).
    Would be awesome if i can make this work :smile:

  • @saschaz. I'm glad you are trying out "Navigate Section Headings TOC." Sorry I didn't leave clear enough instructions. All you have to do is add a trailing "/" to the path to your zettelkasten. I've updated the Readme associated with this macro to reflex this detail I forgot to mention. Thanks for pointing it out. It makes it better for the next person trying this macro out.

    /Users/sascha/Documents/Zettelkasten/

    This should bring happiness. Let me know.

    Just as I was going to post this I noticed that there are 4 actions missing at the end. I don't know if you didn't include them in your screenshot or they are actually missing.

    If they are missing, please redownload the macro from this link. Otherwise the pathname change is probably all that is needed.

    Image with all the actions expanded.

    Will Simpson
    I must keep doing my best even though I'm a failure. 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

  • Dear @Will , thank you for your reply and your help. yes, i only posted part of the KM macro where i made a change, to not lengthen my post too much. i added the trailing "/ " to the folderPath of my Zettelkasten location (in Finder: Edit -> press option key "Copy as pathname"). Still didn't work.

    I re-downloaded the macro you posted just now, and using this latest version, just to be sure. added my Zettelkasten folderpath with "/" at the end again - doesn't work yet unfortunately.

    what else I've tried so far:

    • try different hot keys to make sure i don't have the same hotkey somewhere else
    • change default note extension in TheArchive in settings/advanced (txt vs md)

    The title of my note gets copied into the clipboard (via variable "zettelTitle" , shortcut [option + command + C].
    After each trigger, I can paste and my note title gets pasted as "Link to Note" - it works until here.

    There should be a popup / prompt with a list of all the "#" sections. This never happens, that's where I'm stuck and scratching my head. (i guess the trouble starts around the purple section "Execute Shell Script" - way above my head ;-)

    I've tried the macro on my iMac and on my MacBook Air, and can't get it to show me the popup / prompt. It's strange, i must be missing something.

    What about other Zettlers: (and not to bother Will too much): Does it work "out of the box" on your machine?

  • @saschaz, there are two possible issues that your explanation made clear to me.

    Don't "change the"change default note extension in TheArchive in settings/advanced (txt vs md)." Leave it where you've set it. you do not want a mix of zettel extensions. I'll assume you've have it set to .txt? Is this true?

    Will Simpson
    I must keep doing my best even though I'm a failure. 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

  • Yes, it's set to .txt. I've only changed it to .md to see if i can make it work / if that's the issue. Settings are back to .txt

  • Great, notice that in the "Execute Shell Script" action at the very end of the command is ".md" and this wants to be changed in your case to match the extension format you use. New shell script is

    egrep -e '^#+ ' "$KMVAR_folderPath$KMVAR_zettelTitle.txt"
    

    Give this a whorl and let me know.

    Will Simpson
    I must keep doing my best even though I'm a failure. 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

  • Awesome! it works now, and it is magic :) Thank you, @Will!
    I've just pimped up my Zettelkasten with your KM script B)

    To recap, for anyone else who couldn't make it work: 2 adjustments are needed:

    1. folderpath location needs to end with "/" character
    2. file-ending (.txt or .md) in the purple-color "Execute Shell Script" section needs to be adjusted to the same file ending in TheArchive in settings/advanced (txt or md) - called "default note extension"

    Thanks for your help.

  • edited May 2022

    Many thanks, @saschaz. I consider this to be my error in not including clear instructions. I've since made changes to the README part of this macro that will empower new users appropriately to include the needed adjustments.

    I'm working on a super-duper secret Keyboard Maestro macro. I couldn't think of an elegant way to capture the specific zettel I have active in the editor, and your pointing me to this macro solved that problem, so again, thank you.

    Please don't be hesitant to ask questions.

    Will Simpson
    I must keep doing my best even though I'm a failure. 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

Sign In or Register to comment.