If you try to open the DEVONthinkURL in a Browser, you’ll see why your approach seems to fail. the browser asks to open DEVONthink and the picture you see is in a windows ‘owned’ by DEVONthink.
It looks like what you are hoping for is for DEVONthink URL to act like a local file:///... type URL when used as a src value of an HTML img tag. A tried the latter and it failed.
When using $PosterURL you are essentially calling a webpage as the map icon fill. But a DEVONthink URL content isn’t, I think, passed as a web page. All (pseudo-)protocols are not the same!
I did try a note using $PosterTemplate, putting the DEVONthink URL of the stored image in $URL and setting the body of the template to:
<body>
<img src="^value($URL)^">
</body>
e.g. an src of “x-devonthink-item://5CB08B1C-B9AF-44FE-8982-B1D98DE7E932”. No joy.
If you can get a web-page to show an image served via a DEVONthink URL, the above would work. As such you might do better to ask on the DEVONthink forum about the latter generalised scenario. IOW, “Can a local HTML page use a DEVONthink URL to show an image in a web page?” This takes Tinderbox out as confusing factor, as the real underlying question is whether a DEVONthink of an image item returns an image or some other data/object.
This script copies the selected DEVONthink record’s file:/// URI
-- DEVONthink - Copy URI
tell application id "DNtp"
try
set theRecords to selected records
if theRecords = {} then error "Please select a record."
set theRecord to item 1 of theRecords
set theRecord_Path to path of theRecord
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
return
end try
end tell
tell application "System Events"
try
set theFile to disk item theRecord_Path
set theFile_URL to URL of theFile
on error error_message number error_number
if the error_number is not -128 then display alert "System Events" message error_message as warning
return
end try
end tell
set the clipboard to theFile_URL
display notification theFile_URL with title "URI copied"
If $URL is online it works, but the same file as a file:/// protocol URL doesn’t work, although I can open that DEVONthink-derived URL in my web browser.
Given the difference is my be an OS level permissions issue (though Tinderbox app has full disk/system access permission on my Mac at present).
So, close. We have most of the pieces, even if not a working end point.
My reading is that the OP wants the image set dynamically from an attribute via a DEVONthink URL. Do image adornments allow their image to be set via action code?
I don’t think the request was dynamic – which I interpret as meaning “if I change the image in DEVONthink then it changes in Tinderbox”. DEVONthink file:/// and x-DEVONthink-item:// URIs are static, in any event.
Its amazing what happens when you refresh the view! Sometimes problems get solved…
Problem Solved. (user error, me) +1
Pete, thanks for your script…works perfectly. You are a genius!
I added Pete’s script to a Keyboard Maestro shortcut…pasted the result in the PosterURL (by the way, it works even if the image does NOT reside in Desktop or Document
Good. Ironically, i’m seeing something similar. Some 4hours ago, nothing I could do would make a valid local file:/// URL work via $PosterURL. It looks like I was using tab-switch to generate a full refresh (with it wasn’t) but an explicit refresh caused by clicking the tab table of the current view.
So i looks like I was misreporting an error upthread due to a false negative result. Adding a valid local path as the value of $PosterTemplate does not, of itself, seem to cause the current map object to refresh it’s internal contents. Or at least that appears to be the cause of the confusion.
One thing I learned in this journey is with Posters, I created a workflow between GoodNotes 5 and Tinderbox.
Since GoodNotes 5 allows you to share a link, I can now paste the link into the PosterURL and see the handwritten note in Tinderbox map. Nice way to take notes and see them in Tinderbox.