Zettelkasten Forum


Alfred Workflows

Is there any chance someone could port over some of the Keyboard Maestro macros into Alfred? I've downloaded the one workflow that's already been posted which is very useful but would like it if someone could post a port of the macro which allows you to search all your links and automatically paste the selected link into the file. I've been trying to figure it out for hours but I think it's beyond my current capabilities.

Comments

  • This is the code that works for the similar tags function:

    cd ~/Dropbox/zettelkasten
    query=$1
    
    result=$(egrep -ohs '^Tags:.*$' -- * | egrep -ohs '#[A-Za-z0-9_\-]+' | egrep -hs "$query" | sort | uniq | sed -e 's/.*/{"title":"&","arg":"&"},/' -e '1s/^/{"items":[/' -e '$s/$/]}/')
    
    if [ -n "$result" ]
    then
        echo $result
    else
        echo "{\"items\":[{\"title\":\"Create Tag: #$query\",\"arg\":\"#$query\"}]}"
    fi
    
    

    And this is the code that works for the keyboard maestro version of what I want to achieve:

    cd ~/Dropbox/zettelkasten
    ls -t | sed -e 's/.[^.]*$//'  ## this is assigned to a variable call tmp
    ## tmp is then displayed as a list then
    [[%Variable%tmp%]] ## link is pasted into the document when selected
    ## clipboard is cleared
    
Sign In or Register to comment.