Some aTbRef small page tweaks

I think DEVONthink scripts often “tell” a window, called (I think) a ‘think window’. I’m thinking the comment about windows originally may have been influenced by that. Or maybe by a “gui-script” in the days when only that was possible with Tinderbox. I vaguely recall you had a nifty web clipper that may have addressed a window before pasting. In any case, now there is potential to confuse.

The aTbRef articles are most helpful in pointing out the way to put the focus on a note. That is highly specific to Tinderbox, thus not obvious. Not at first being obvious is of course nothing unusual in AppleScript!

According to the Tinderbox AppleScript dictionary, ‘find note in’ is always followed by a specifier, which can be either a document or a note.

If the script has “told” a document (but not “told” a note) then ‘it’ is needed to specify the document. That seemed awkward to me at first (wait, what exactly is the antecedent?). But in AppleScript ‘it’ typically refers to the object that the current tell block is addressing, e.g. front document.

Sometimes omitting a tell block results in more natural language.

This works:

tell application "Tinderbox 10"
	tell front document
		set notePath to "/Note 1"
		set theNote to (find note in it with path notePath)
		evaluate theNote with "links.inbound..$Name"
	end tell
end tell

But this may seem more natural:

tell application "Tinderbox 10"
	set notePath to "/Note 1"
	set theNote to (find note in front document with path notePath)
	evaluate theNote with "links.inbound..$Name"
end tell

In any case, Tinderbox has solid AppleScript support for getting data from/to a wide variety of apps. Until something better for that than AppleScript comes along (not in the offing, it seems) it’s a great thing to have.

1 Like