Add file reference to Note $Title or $Text?

I’d like to add a PDF to a TB document. I see that dragging it into the Text Pane leaves me with a somewhat small to medium image. But I’d like to click on that image, or a reference to the file itself, so the PDF is loaded (by Preview or whatever), so I can read it easier. Is there a way to do this?

I didn’t think you can use a $Text-embedded image as the anchor for a Tinderbox text link, but you can! On a train with v poor data connection but testing (albeit with a JPG I had to hand & not a PDF). So:

  • In Finder, I selected the source file for the embed, right-clicked and the Option+clicked on the ‘copy’ to get the file’s path.
  • In Tinderbox, I clicked the image (don’t try to drag-select it) in the note’s $Text to select it, then Note > Make Web link. In the URL box type file:// and then paste in the file’s path.

Your embedded image is now a link to the file and the file will open in whatever Finder [sic] things is used to handle that file type. For instance, my JPG opened in Preview.

You could also create a file-type user attribute, make that a KA and use that to link to the source file but I think you want the extra agency of clicking on the image in the note text itself.

2 Likes

Thanks, Mark. Two things:

  1. I must drag select that image, otherwise I don’t see Make Web Link in the Note menu.
  2. After creating that link, I do indeed see the Hand Pointer when hovering over the image, but clicking doesn’t do anything.

However, using the $File attribute serves me well in situations where I have only a single image in the $Text pane.

Is there a way to store a file within a TB document? Not just hold its reference.

Ralph,

Odd, I think both issues 1 & 2 reflect the fact that this particular usage - linking from an embedded image - wasn’t likely envisaged. I’ve seen no reference to it before and until I tried this morning I didn’t think it was possible.

So, selecting the image seems iffy. I’ve tried with/without text around it and with without dragging and I think it’s trail an error. If you can see the web link option, you’ve got a selection. It’s not entirely clear what is selected, it may be the selection is zero-length, making it hard to tell where to click.

As to the linked item not opening, this works consistently for me. I’ve now tried a PDF as well as a JPG. My URL looks like:

file:///Users/username/Pictures/interwingled.pdf

I’d validate your ‘file’ URL outside Tinderbox using some other method. It may be the URL needs further escaping/encoding, or that Finder doesn’t know what app to use for that file (ought not to be so if it is a PDF).

I’ve seen nothing to suggest Tinderbox expects to be used as a file store, indeed I’d not suggest trying. If you need the latter, I’d suggest emailing the usecase to Eastgate as a feature suggestion. At the same time you might mention the above as it might perhaps be reviewed to make it easier to do, thus obviating the need to store the document in the TBX.

1 Like

I also find that often I can’t successfully drag a PDF to the $Text Pane. See this GIF.

One thought. PDFs are a wrapper for all sorts of stuff. It might be the parser can’t read the particular flavour of PDF. For instance, a locked PDF might cause an exception for if the parser expects to be able to extract info, and so on.

I’d check with support, using a reference PDF that repeatably doesn’t embed.

1 Like

Well, using the $File KA gives me a lot here, and lets me write text more easily in the $Text pane. I find that writing text around the embedded image (when I can actually get that image in there), is very small for some reason.

I also can do a lot with images like PDF files, etc., in Curio and place a TB document reference in the same Curio project.

Not sure exactly where I’m going with this right now. I was using Curio for much of what I’m now using TB for.

The underlying architecture of Curio and Tinderbox are quite different. Each Tinderbox file is a single, self-contained, XML document. Images and PDFs dragged into Tinderbox are transformed, encoded into an RTFD attribute. (Specific magic unknown to me.) As @mwra pointed out, YMMV. PDFs in general – like web pages – are a crap shoot depending on where the PDF originated.

Curio on the other hand does not transform file assets dragged into a Curio “project” into other data types. The source file is preserved inside a filesystem folder that is hidden inside the project. Curio attempts to use Quicklook to show the contents, if possible, otherwise Curio just shows an icon as a placeholder for the dragged-in file.

1 Like

Yep. A TB project is a UI presentation of an XML file, and a Curio project is a UI presentation of a package of related files. I’m slowly integrating their strengths with each other, though I find myself spending 99% of my working time in the TB side of a project, in Outline View.

1 Like

Ha. Me too. some sorts of work favour certain views. at size, outline works best, even if I ‘think’ in map view terms about my data.

1 Like

I’ve always wondered if .tbx files could become “bundles” (similar to Curio documents).

A bundle would include the xml document we all know and love, along with any attached files, images, etc. It would be neat to have attachments/linked files remain in their native format and not worry at all about file paths.

Well, you can have references in a TB document by just using the $File attribute, making it a Key Attribute for this or that Note. It will load with the application associated with that file type, just as if it was loaded via Finder.

I think the beauty of TB is that each project is a single text file, making it very portable and transparent in terms of stored data. Making a TB project a bundle of files would change all that. However, you can approximate this if you want, by just creating a Curio project and drag a TB file into a Curio Idea Space (as either a file reference or a real file).

I seldom use external files with Tinderbox. $File references often fail because paths are fragile. I avoid dependencies on where files are sitting whenever possible.

I’m not aware of a way to use relative paths, which would be handy. I could create a folder to hold the Tinderbox .tbx document along with a ./files or ./attachments folder for files. If the paths in $File attributes could be something like “./files/myimage.jpg” (relative to the .tbx file) it would allow me to make my own portable, bundle-like package.

I actually do use Curio with embedded Tinderbox documents now, as you suggested, but that doesn’t help much with references from within TB.

Honestly, my preference would be to allow files dragged onto notes to be automatically moved into the .tbx “bundle” and referenced with a relative path in the $File attribute. That’s pretty drastic, so, as with Curio, the option to move/copy/link would be required.

It wouldn’t surprise me if I was the only person who thinks this is a good idea :).

4 Likes

I would also like a Relative Path option for $File. I tried a few possibilities before, and none of them worked. I wanted to put external files in the same folder as the TB document, and go from there.