If a note has an embedded picture, what programmatic code is available to access the picture? Goal is to be able to extract embedded pictures for separate handling later in code.
There isn’t, AFIAK a method for this. This doesn’t surprise as notes are not generally envisaged/intended as multi-media repositories. In-note pictures are there because some users have expressed a pressing need for them. It works fine in-doc and in formatted (default - HTML) export in-$Text images are exported as JPEGs. But note $Text is still not envisaged as an asset store.
A more plausible solution—in that it fits better with Tinderbox’s roots—is to store the image externally and hold a link (local path, app pseudo-protocol, etc.) to it. The note is then amenable to reference/collection via action & export code even if the image is embedded in the note’s $Text. Not least, it allows you far finer control over the size/format/quality of the image.
Thus, it al, begs the question as to what you want to do with the image? I ask as there might be a different route to the outcome by a different means.
@mwra Thanks for your quick response. I agree fully with the structure you laid-out. This question has to do with my (struggle) to get the “TBX to DEVONthink” to work. My present solution is simply to include a “template” identifying that there was indeed a picture in the note being transfered to DEVONthink. This will at least give the user information about the picture and a way to include it manually in DEVONthink.
Are you not sending DEVONthink the note’s styled text? That ought to include the image attachments…
I’m trying to form a x-callback-item from an existing TBX note transfered to DEVONthink as a markdown item. The text is scanned for links and if found are converted to markdown text. In $Text I only find this code:
<p> <img src="Note 3.jpg" alt="" > </p>
and I would need to grab this file and send it to DEVONthink so a link can constructed to form a “
In my present version I merely indicate to the user that an image was found allowing manual update in DEVONthink of the picture info.
[moderator edits to reveal code samples]
I have found, long-term, that the most efficient strategy for multimedia is to have. Media directory on the hard drive and have tinderbox pointing to that. Likewise, you could have Devonthink point to the same folder. This way, images, audio, and video can all have consistent treatment, which also makes output and related handling more consistent. The challenge with storing images in Devonthing is the DT paths won’t resolve in HTML, again, and ergo the use of a media directory. You can see me working with media videos that provide a brief explanation of this. I have a much more refined process now, but the sentiments in the video are generally the same.