Having taken first humble steps into creating my own zettelkasten (and being a strong proponent of only using one app for my data management, i.e. Devonthink) I quickly stumbled across @benoit.pointet absolutely fabulous script to create a graph view.
obviously the key to a zettelkasten is connecting the atomic notes and at least in my case most of the time these should be bi-directional links, which is a little cumbersome to maintain by hand. and while I am sure there are better ways of doing this and definitely more elegant ways to code it, I have written my very 1st applescript to append the names and links of selected markdown files to each other. in other words each of the selected files will link to each other file after the script has run:
-- script to add file names and x-devonthink links of each selected markdown file
-- to each of the other selected markdown files (bi-directional links).
try
tell application id "DNtp"
-- get the selection
set thisSelection to the selection
-- error handling: has to be two or more files
if (length of thisSelection) < 2 then error localized string "Please select two or more (markdown) documents, then try again."
-- loop over the selected files
repeat with theItem in thisSelection
set theURL to (reference URL of theItem)
set theName to name of theItem
-- inner loop to match all files
repeat with theInnerItem in thisSelection
if theInnerItem is not theItem then
-- append name and x-devonthink-link of thisItem to theInnerItem
set oldText to plain text of theInnerItem as string
set newText to oldText & return & "- [" & theName & "](" & theURL & ")"
set plain text of theInnerItem to newText
end if
end repeat
end repeat
end tell
on error errMsg
display alert (localized string "error when adding names & links to items") message errMsg
end try
thanks in advance for any pointers to improve this or simpler ways of achieving the same goal. and happy if this is useful for somebody besides myself…