First time using Posters: Question: Is there a way to configure Posters to show Devonthink jpg note via URL or a Poster Template?

Here is the context…

I am not sure if this use case is possible, but here is a scenario where I am hoping to figure out.

I have a Devonthink database with a jpg file. An image that I would like to visualize in a poster

here is an example of the item link Devon gives me

x-devonthink-item://8907E90E-A3B0-4F89-A393-A19287963718

If I paste this link into Tinderbox as a URL, it works fine if I click the URL icon in the DA, it opens the DEVON note IN a DEVONthink window. Fine

However: if I paste this url into the PosterURL I get a blank white box.

What I want/hoping is for the image to appear in the Poster window

Here is what I see

image

Here is the export code

I am sure I am missing something? Has anyone tried this?

Tom

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.

1 Like

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"

4 Likes

Thanks Pete,
I will give it a try later today after my meetings.

Tom

Turns out there may be another block. I tried using $PosterTemplate with this body content:

<p>HELLO</p>
<img src="^value($URL)^" height="80">

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.

Though Tinderbox has full disk access, posters don’t. (There are excellent security reasons for this)

If you want to display a jpg in map view, why not use an image adornment?

2 Likes

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.

Ah. OK: is it essential that the image be in DEVONthink? If the image is in the Documents or Desktop folder, I believe you’ll be fine.

PosterURL: file:///Users/xxx/Desktop/The_Daughters_of_Edward_Darley_Boit,_John_Singer_Sargent,1882(unfree_frame_crop).jpg

1 Like

Humm

I cannot get the Desktop or Documents to work via PosterURL image

ps…I am using the latest beta

Do you have Desktop and Documents in iCloud? Funny things can happen when that is the case.

NICE thought…but no, no syncing Desktop or Documents to iCloud.

Many thanks Martin

Tom

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

works fine here

Tom

1 Like

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.

No, it doesn’t. Perhaps it should.

1 Like

Posters are cool.

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.

Tom

3 Likes

Interesting. This works also with GoodNotes 6, but in a fiddly way. That’s not on Tinderbox – GoodNotes is a clunky app.