Using evaluate (introduced in TB 8.0.4)

a faster (and arguably simpler) route to a full listing of document paths than an equivalent reading through the osacript note object hierarchy would be

Ah, thanks for the pointers. I’m beginning to see the power. Now can incorporate the internal Tinderbox code into external code in a script, giving the best of both, and simplifying life.

For example, a script solution to the problem posed in Trying to make a simple list of tags thread can now be a one-liner!

tell front document of application "Tinderbox 8" to set the clipboard to (evaluate first note with "collect(all, $Tags).unique.sort.format(" & quote & return & quote & ")")

Or to get the tags into an AppleScript list for manipulation in AppleScript can be something like this:

tell front document of application "Tinderbox 8"
	set theTags to evaluate first note with "collect(all, $Tags).unique.sort"
end tell

set tagsLst to makeAList(theTags)

-- handlers

to makeAList(semicolonDelimitedString) --> AppleScript list
	set text item delimiters to ";"
	return semicolonDelimitedString's text items
end makeAList
1 Like