How does TBX process/relay images in a Watched Folder?

I created a test project, made a Note and set its $WatchFolder Attribute to a local folder containing images.

I observed 2 things:

  1. If there is only 1 image in the Watched Folder, TBX will not include the image size within the file size. However, if there are multiple images in the Watched Folder, the TBX project becomes around 40% larger than the sum of the sizes of all images in the WF

  2. Viewing within TBX -
    a) When there is 1 image in the WF:

    • viewing the Note with “Text Pane Selector” set to “Text”, I see the image.
    • set to “Preview”, I see just a “0”
    • set to “Export”, I see some XML / OPML header and code, and a mention of the filename but no visible file path info.

    b) With multiple images in the WF, the Note functions like a Container:

    • viewing each Note within the WF with “Text Pane Selector” set to “Text”, I see the image.
    • set to “Preview”, I see the filename as it exists in the Finder.
    • set to “Export”, I see some XML / OPML header and code, and a mention of the source filename, but no visible file path info.

What am I seeing in each case?

Yes, as expected because the watch folder pulls the image into the notes. Tinderbox bloats images pasted into notes.

Yes, because the preview is looking at the exported text and the embedded image in a note is NOT rendered in preview.

You are seeing the difference between the RTF layer in text holding and rendering the uncompressed raw data of the image vs. the preview using the preview browser to under and image from the hard drive. That is why I always rely on direct links to the image on the hard drive. It is the only way to publish and reliably get the images out of tinderbox and not bloat your file.

Thanks for the clarification, @satikusala. I was puzzled as to why Tbx only seems to ‘pull’ images into the Note structure if there are multiple image files in the WF.

Is the takeaway here that one should avoid, as far as possible, promoting an external folder to a WF if said folder contains multiple images?

I’d suggest asking why watch a file containing images. Tinderbox is primarily a textual annotation/anylysis tool not an everything bucket file manager.

The way to think of text pane Preview is for previewing web pages before export. So, includes like images, javascript, whatever, may work there but don’t simply expect it to. The fact the Preview has since been bent to it acting like an in-add Keynote-like presentation mode is again an aside. In this context, you are intuiting is acting like Finder/Quicklook. I note this simply to surface how assumption lead you astray.

As regards images, I’m with @satikusala, I think they are best left outside the doc unless you absolutely must have everything in one doc. If the latter, then I strongly advise not just dragging any only image into your TBX, but first checking the file size and cropping/compressing down to the minimum size needed. As for (Tinderbox) watched folders, I’d put images in that dataset in separate, un-watched, folders to that of watched text files. Watched folders are not a file manager. If you just want to be able to see what’s in an OS folder, use $File (or a user File-type attribute) and set as the note’s Displayed Attributes. Then, clicking the folder icon will open a Finder [sic] window showing that folder, which of course then has all the usual image previewing method available.

TL;TD here, I think, is used watched folders for textual material, i.e. ‘notes’ rather than as a file tracker.

Now, if you want to view the image in TBX, you can use hover or $Fiil.

1 Like

My guess — I’ll have to check this — is that Tinderbox checks to see that there’s at least one file in a watched folder, and it doesn’t consider a lone image to count. It should, but I can imagine that might be the explanation.

I agree it’s wrong.

I’m wondering if we could have watch folders create a note with the path in $File rather than displaying it in text. We could then use action code to parse File to create the $Hover and $Fill parameters. This could help with the bloating issue.

1 Like

Thanks @satikusala, @mwra, @eastgate for the insights and information.

I’m happy to have a minimum number of images in my Tbx projects. In fact, as of now I have none! I rely on external links to local and web-based content. And I don’t really want a Watch Folder for my images - but I would like to be able to drag content onto my Tbx projects without the action actually adding the content to the project file - for example, Shift-Drag/Shift-Opt-Drag to generate a Note with $File/$Hover populated and source file copied/moved to a pre-defined location would save me several discrete steps and massively improve my content-ingestion process.

All this becoming more necessary in light of a few developments in note-taking and OS technology:

  1. Increasing numbers of PKM/Note-taking apps which use (JS, web-friendly, etc) paradigms in handling external content. These apps will readily allow a user to attach media to their text-based UI - usually by creating or adding content to a /Resources or /Assets sub-dir, and inserting an-inline link/pointer. It would seem unified Media Folders are becoming popular again, at least for locally stored repositories!

  2. OCR’s everywhere now. Everything’s gotten smarter - including images. Media contains meta-data, and MontereyOS now even professes to intelligently read and gather map/URL/number/text information displayed on images (haven’t tested yet :)). Imagine setting up an action to take a screenshot of weather/news/stockmarket info, unattended computer users, and so on - then extract all text from that screenshot to a separate Note…

  3. I should like to be able to drop multiple media files into a folder that’s been designated as a WF, and allow Tbx to figure out how it wants to best deal with the content, or automate based on pre-set preferences.

Just some thoughts for a Friday evening.

1 Like

+1 for ease of use for Images. Even if TBX references it behind the scenes.

1 Like

@eastgate, is there any obstacle preventing Tbx from editing in loco the indexed notes in a watched folder? This would make integration with other apps very easy (e.g. DEVONthink, Scrivener, Obsidian, and so on).

You could do this explicitly by export. For sync, I worry about updates from multiple sources and other edge cases.

1 Like

Exporting is pretty fast, so, in a way, I guess it could serve this purpose. But, should you ever deem it feasible (that is, allowing Tinderbox to edit files in a watched external folder), I think many of us would be very excited about that. One could use it, for instance, to sync notes to Scrivener (it has a feature called Sync to External Folder that allows something akin). In essence, this would make it a breeze working with Scrivener and Tinderbox in tandem.

Apologies to the original poster, @archurhh, if I drifted slightly off-topic here.

Haha no worries…! Editable files in WF sounds like a dream to me :grinning:

2 Likes

In the meantime, and though it is not as tightly bound as the suggestions above you can take a copy of the WF note, edit the text and export it to the WF, which will then synch.

I’d also suggest some clarification of the idea of editable WF. I’d assume these would be plain text files (TXT, MD, HTML,CSV, etc.). supporting richer forms e.g. RTFD, would ISTM make the necessary engineering more complex. But, if the desire (need?) is for the latter it’s worth that key constraint being made up front.

2 Likes

If the number of notes is small, this could work, I assume. But with too many notes, keeping two copies of the same note could make it unpractical.

Yes! Good point. I meant plain text, of course.

2 Likes

Just tested Live Text on MacOS Monterey to pull text off a screenshot - it’s a game-changer, I swear.

1 Like