Notes possess a property, links
, which is a listing of all outbound basic and text links from that note, i.e. any outbound intra-document links (for links out of the TBX see further below). Links are read-only and have three properties:
- the source note
- the destination note
- the path name
This sub-routine can be used for setting a link, optionally of a given link type, to from the current note to a specified note:
on linkFromNoteToNote(linkTypeName, fromNote, toNote)
tell application "Tinderbox 10"
if linkTypeName != "" then
set strType to linkTypeName
else
set strType to "*untitled"
end if
set strID to value of (attribute "ID" of toNote)
evaluate fromNote with "linkTo(" & strID & "," & strType & ")"
end tell
end linkFromNoteToNote
Note that the to/from notes are passed as references (likely variables) to Tinderbox AppleScript note objects.
A link object exposes a number of properties.
External Links
Any links terminating outside Tinderbox, e.g. web links, are not accessible to AppleScript via the links
property, though it may possible to access them via the contents of the $Text attribute of the note, as a rich-text feature.