Shortcut ideas, if you want a latest ID based on file name

HI

I am waiting for the plugins to be possible.
So at the moment I have a folder for Zettelkasten id and name as the file name
1 Models
2 Faith
3 Graphs

Then etc
3a Line Graphs.

I then link them using links or tags #z1 #z3a etc

So I wanted
a) the next id, when I make a new file.
b) a copy index of the ids, to update my Index page.

I found espanso plugin for shortcuts.
Then could add bash scripts so I made two that do this, if you would like them too:

  - trigger: ":zid"
    replace: "{{output}}"
    vars:
      - name: output
        type: shell
        params:
          cmd: "~/zNumber.sh"

NEXT ID:
zNumber.sh

#/bin/sh
# gets the whole number adds 1. use ":zid"
zid=$(cd ~/Dropbox/Zettelkasten/; ls -1 [1-9]* | sed 's/ [a-zA-Z0-9.]*//g' | sort -h | tail -n 1); echo `expr $zid + 1`

LIST OF INDEXED TAGS:
zNumberIndex.sh

#/bin/sh
# LIST TAG added #z with 2 level indent #z1 > #z1a > #z1a1
cd ~/Dropbox/Zettelkasten/;
ls -1 [1-9]* | awk 'BEGIN { FS = "[\d]* " }{print $1}' | sort -h | awk '{if($0 ~ /[a-z]/) { if($0 ~ /[a-z][0-9]/) { print "\t\t#z"$1 } else { print "\t#z"$1 } } else {print "#z"$1}}'

If you can improve or have other ideas let me know.

tristan

1 Like