Tinderbox Forum

External links to tinderbox notes

I just tested this (you could too :smile:):

  1. If a note is selected in a Tinderbox document, and Hook is invoked, then Hook in Hook use Copy as Link, it will copy the file:/// address of the document.
  2. If a note is selected in Tinderbox and I use Note > Copy Note URL (or the shortcut), and then use Hook on something outside of Tinderbox (say, a file), then use Link to Copied URL in Hook, one can link something directly to a note.

Thus there is limited (but useful) integration already possible.

  1. Since Tinderbox now has scripting, someone at Hook could write a script that invokes attribute of and grabs the content of $NoteURL and then deeper integration would be possible.

2 Likes

Yep. I noticed bullet point 1 above. Didn’t know about the second bullet point. What I was looking for was a nice icon to paste (as with apps Hook recognizes). I don’t really like the file:/// address string. But it does work. Thanks, Paul.

That’s why I made point #3 – if CogSCI wants to write a script to link directly to a note using Hook’s built-in script-running feature, it can.

I’ll post in their forum.

1 Like

Edit: weird, but I tested Hook + Tinderbox several times this afternoon, and then it suddenly stopped working with Tinderbox. Hmmm… certainly not a Tinderbox error, that’s for sure.

Hi, I’m from CogSci Apps. Thanks for all of this. We will try to build in the integration and let you know if we encounter any issues.

I’m looking forward to the integration.

6 Likes

Seems to be working here after adding a Tinderbox 8 entry in Hook preferences with a Get Name script:

tell application "Tinderbox 8"
    tell front document
        set xs to its selection
        if {} ≠ xs then
            value of (attribute "Name" of (item 1 of xs))
        else
            name of it
        end if
    end tell
end tell

and a Get Address script:

tell application "Tinderbox 8"
    tell front document
        set xs to its selection
        if {} ≠ xs then
            set target to item 1 of xs
        else
            set target to it
        end if
        return value of (attribute "NoteURL" of target)
    end tell
end tell
7 Likes

I was counting on you, Rob! Thanks.

1 Like

Let me know if you think it needs adjustment.

(Perhaps it should be a little more defensive or less ‘partial’ – additionally covering, for example, the case where there is no document open in TB8)

Or more “plain vanilla” AppleScripty versions… (Not yet tested with Hook but results tested to be the same as @ComplexPoint scripts).

tell application "Tinderbox 8"
	tell front document to if it exists then
		tell selection 1 to if it exists then return value of its attribute "Name"
		return value of its attribute "Name" -- "Name" of Tbx document if no note selected
	else
		error "No Tinderbox document open"
	end if
end tell

And…

tell application "Tinderbox 8"
	tell front document to if it exists then
		tell selection 1 to if it exists then return value of its attribute "NoteURL"
		return value of its attribute "NoteURL" -- "NoteURL" of Tbx document if no note selected
	else
		error "No Tinderbox document open"
	end if
end tell

Interesting to learn about Hook!

JXA scripts as well?

1 Like

I’m not sure that Hook is capable of passing on error messages generated by embedded scripts. In my experience if it doesn’t succeed it just fails silently.

In principle one should be able to use JXA with the script starting with //JavaScript. This is a currently undocumented feature. I myself need to get clarity from our developer who added it! I will reply here when I have it.

Coincidentally, we have very recently added a failure notification in an unreleased build – the feature isn’t complete. We will document it in its release and I’ll update here accordingly. It should (at least optionally) pass on the message. Whether to use a macOS notification or just the status panel is a question. Probably should have a preference for this, and perhaps introduce a “Debug Mode” for Hook.

1 Like

Not quite there yet, I think :slight_smile:

At the moment following a //JavaScript line with JS values other than string literals returns either undefined or puzzling URL-encoded strings, which is:

  • encouraging (certainly a sign of some JS evaluation going on)
  • not yet usable, I think, the expected string return mechanism is unclear (and there seems to be a missing urlDecode phase)
\\JavaScript
"hello" + "there"

–> hellothere

which seems a good start, but then

\\JavaScript
Application("Finder").name()

–> undefined

and least predictably of all:

this

–> %5Bobject%20GlobalObject%5D

Which suggests an opacity or slight oversight at some point in the process.

It will be very useful when it settles down, though.

PS a clue to some kind urlencode ⇄ urldecode gap is suggested by the fact that:

\\JavaScript
"hello there"

–> hello%20there

Updated versions of Hook scripts for Tinderbox:

2 Likes

The scripts designed by RobTrew (@ComplexPoint) were incorporated into Hook’s integration scripts (with minor tweaks) on Dec. 8: Version 94 of the integration scripts, available as an in app update. And they will be in Hook 1.3.3 itself.

Thanks to Rob; we’re delighted to help bridge Tinderbox to all kinds of content on your Macs and beyond.

4 Likes

Thank you for the Hook updates for Tinderbox compatibility,

My main hurdle with Hook is that there is no way to know which notes, or documents, or webpages have been set up with relationships in Hook – especially after time has passed. I was keeping a little notepad (manual) telling me where to look but stopped because that seemed silly.

Not a complete solution, but Hook places a Finder tag on files that have a relationship managed by Hook. So at least all your documents linked to/from can be found. That obviously leaves out webpages and anything managed by applications (Tinderbox, DEVONthink).

That’s helpful – but it’s limited as @ottmar pointed out. As if all that Finder showed us is .txt files. Hook is useful, but not complete – more of a beta, IMO.

Thanks, @PaulWalters and @ottmar. Regarding “not complete – more of a beta, IMO”. Well, Hook is billed mainly as a contextual access tool , as opposed to a search tool — one that provides the missing links. I.e., it’s described mainly as something that helps you link items together, something that was missing from macOS. If it were billed as a search tool, and didn’t provide search, then it would not even be beta. Consider the web: resources, links and a search engine. But the engine (e.g., Duck Duck Go or Google) isn’t for finding links, it’s for finding resources. So Hook doesn’t have a tool for random access to links. It’s more like associative memory than random access memory (that’s just an analogy). It doesn’t replace whatever aggregation tools people have. It’s meant to augment existing software, and help it work better together (link content within and between apps).

Having said that, we’ve had several requests (including here) to view multiple links (and aggregate info beyond 1:1 links), so (likely starting with 1.5) Hook will begin to introduce features along those lines. At that point we’ll expand how the tool is described. Whatever features we add or will add be based on its simple premises (e.g., facilitate contextual navigation of information; augment/leverage/bridge existing software rather than replace or compete; remain lean). Otherwise, the software would bloat. We anticipate several rounds of augmentation re this, some of which has already been described on Hook’s forum.

We’re delighted to have support for Tinderbox and we look forward to hearing how people use it. We’d like to publish some showcases, and we invite people who use Tinderbox and Hook together to share their usage; and we will continue to listen for ways to do better. For instance, we’d like to support multi-select in Tinderbox, which the current integration currently doesn’t (but a script written by RobTrew does, I believe.)

Yes, of course I know Hook isn’t a search tool. My analogy isn’t intended to suggest it is.

My problem: I have a Tinderbox document with several notes linked too other resources (files, etc.) with Hook. And I have many documents in DEVONthink linked similarly with Hook. But a day, a week, a month later when I want to find which of the Tinderbox notes or DEVONthink files have been set up with Hook links there’s no way too figure that out without clicking around, opening and closing Hook to look at its display, etc.

Frustrating. Maybe I just don’t understand the intended use case.

2 Likes