DEVONthink and Trickster integration

Hi Joe,

Where does the DT3 icon appear in the window?
When you say that you “double-click on Trickster”, what do you double-click on, exactly?

here’s a short screen video of me trying to open pdf in DT3
you can see the DT3 icon appears just in front of the file as per your video.
when I double click (or cntrl click to ‘open in’) the recents files on the right hand pane, all that happens is the DT3 icon appears above the recent pdf file - nothing opens
hope this helps

Joe

hmmm, a PS
it seems there is no DT3 icon in the recents pane
see: CleanShot 2022-02-11 at 09.30.16 · CleanShot Cloud
this could be because when I looked in system preferences Trickster only had permission to control the Hook app (when I set it up initially, I added DT3, Hook and Alfred). So something seems to have gone wrong, so I used terminal to reset all permissions, then reinstalled Trickster and only authorised it to access DEVONthink and still had same behaviour (tho it seems the DT3 icon is no longer visible…)
does this help?
Joe

PPS: two more screenshots showing system preferences

hopefully that helps you figure out what’s going wrong
thanks,
Joe

@BurntNorton
First, in the compact mode (where there’s only the file name, no path row) then DT icon will not show (it’s part of the path), so that’s not a bug.

From your video, I see that you try to open the same document in DT that’s already the top document, so it doesn’t switch. It appears to be DT’s own behavior. Try double-clicking on another document or switch DT to another document first and then double-click the document in Trickster. Does this work?

  • List item

Hi @Jacob ,
thanks for your quick response.
I have already tried what you suggested. I’ve opened multiple documents in different databases (I have 5 databases open at the moment) and I get the same behaviour.
When I click on the document, it highlights in the preview pane below and also then pops up in Trickster window. If I then double click on the newly appeared document in Trickster (or ctrl click to open in another app) then I get exaclgty the same behaviour - the DT3 icon appears but no file opens

Take a look at this video recording of how I enable a Debug log and get the callback URL for the DEVONthink items from the log. I then take the URL and paste it in Safari to take Trickster out of the equasion and, in my case, it opens the documents in DEVONthink fine. See if your callback URLs for devonthink are in a similar format (with an id) and if they open the docs in DEVONthink from your web browser.

NOTE: To see the debug log menu items, you need to press and hold the Option (Alt) key when the menu is open and when you click.

Here’s the video:

Hi @Jacob

I was able to do that, and yes the DT3 document opens in Safari.
log is attached below - this may help figure out what’s going wrong?
does the screenshot showing Trickster does not have permission to open DT3 in the system preferences have anything to do with it? As I said in earlier post, I uninstalled Trickster (with all the presences Hazel identified deleted too), restarted my Mac, then reinstalled but made no difference.
thanks for your persistence!
UPDATE!!
I tried to start yoink (to move the debug log into Dropbox and send you a link) and setapp asked me if I wanted to install the SetApp version and I did that.
Then when I tried to open the files again by double clicking on trickster (in two different databases), nothing happnedned. But when I clicked in the Trickster window and asked it to ‘open as’ I was able to open the files in Highlighter and Preview - strange! Then, I was able to open them directly in DT3 by double clicking in the preview pane of Trickster.
however, when I tried it again after a few moments, again Trickster failed to open the file by double clicking…
…a mystery - so I enclise a link to download the log as that may show the problem
thanks for your support on this - I’m sure this app will greatly increase my productivity when I can get it to work consistently.
Joe
Most recent log attached here: Dropbox - Trickster 2022-02-12 07-40.log - Simplify your life

another update

I’ve called apple support on this to see if they could help me with the permissions issue
DT3 has permission checked to access Trickster (see my screenshots above) but Trickster only has permission to access Hook, NOT DT3.
Under direction from apple, I deleted the app from about this Mac/storage/apps - delete as the support tech said this should remove all preference files with the app.
I then removed the script from DT3
close DT3
then reinstalled Trickster following your video, installing the script in DT3 and setting Trickster integration to Devonthink.
Strangely, Trickster still seems to have access to hook even tho I didn’t set that up again, but NO access to operate DT3. Also DT3 has access to Trickster but Trickster has no access to DT3.
One more think, when Trickster opens, it has kept all my default settings (favourites and always on top), which makes me think that there must be aspects of Trickster that remain on the Mac System even after it has been deleted…
very strange…
help?

Just a quick note, I’ll take a deeper look at your log later:
Not having the checkbox in system permissions is not an issue. This only appears when apps target other apps with AppleEvents (AppleScript). Trickster doesn’t use AppleScript to open documents in DEVONthink, it’s instead done using the callback URL, which doesn’t require automation permissions, so it doesn’t appear. DEVONthink’s Rule to push the opened file to Trickster, on the other hand, does use AppleScript to transmit the details, so DEVONthink has a checkbox for Trickster after you first allow it in the security prompt.

There’s nothing strange in the logs and Trickster gets the IDs from DT.
Also, a note on default settings. User-customized settings for apps in macOS are not kept in the binary, they are kept by the system in separate files and are called “preferences” or “defaults”. Removing a binary from /Applications and putting it back in is basically like doing nothing at all since copies of the same versions of the applications are identical and the preferences and settings are stored elsewhere. Removing the app won’t even remove your database, which is stored in the private container for Trickster. To fully remove data and settings for applications, it’s better to use a specialized app that can clean after removed apps. Hazel can do this as one of its services. CleanMyMac can also do this.

Your failure to open “again” by double-clicking in Trickster could be because perhaps the file was already open in DT or was its top preview. That’s what happens in my case.

As a test, try quitting DT then double-click on some entry in Trickster. Will it open DT and will DT open the item that you double-clicked?

1 Like

brilliant @Jacob !

yes, if I click away to another document in DT and take the DT preview off screen, double clicking on the file in Trickster opens the pdf in the native DT viewer.

thanks for your patience on this! I understand a bit more on the vagaries of apple systems! (and I’ve been a Mac user since 2007).

one other problem tho… when I right click (or ctrl click) in the Tricker pane, and ask the PDF to ‘open in’ this does not seem to work - either in the default app, Preview, or my preferred app to annotate PDF’s ‘Highlights’.

any ideas on how I can get this to work.

If you go to File Tracking Settings and drop the DEVONthink database onto the test zone, what does it say?

The thing is, the files in the database should still be trackable by Trickster’s sandboxing permissions for Trickster to open them as files (even if it to ask to open them as files) and also to generate the previews.
For example, if your DT database is in the [HOME]/Databases folder (the default that DT suggests if I remember correctly), then you need to add this folder to the watched folder in Trickster (see attached screenshot). After you do this, these files will also have a more proper quick-look preview in the icons (in the extended viewing format, with the path and the larger icon).

1 Like

Fantastic @Jacob !!!
that was the problem - added my /databases folder to the watched list and now opens in different apps like a dream
great support, and a fantastic app.
keep up the great work,
Joe (from Dundee, Scotland)

1 Like

Thanks to @Silverstone for sharing the script that allows tracking DevonThink groups with Trickster!

I adapted this script to be run via a smart rule to automate the process further. It can now be run in an “Execute Script” action within a smart rule to add any DevonThink group that is opened to Trickster.

Here’s the smart rule script - all credit to Silverstone for creating it in the first place, I only made minor modifications:

-- Script to add selected DT Group to Trickster's Recents
-- Created by Silverstone on 12.07.2021
-- Modified by AW2307 on 7.6.2022 (to be run via a DevonThink Smart Rule)

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

on performSmartRule(theRecords)
	tell application id "DNtp"
		repeat with theRecord in theRecords
			set theRecords to (get selection)
			if (count of theRecords) = 1 then
				
				-- Data for recent item
				set theRecord to item 1 of (get selection)
				set {GroupURL, GroupName, GroupLocation} to {reference URL, name, location} of the theRecord
				set AppName to name
				
				-- Finding or creating 'Group Links' DT group in Inbox of current database to store all link files
				set theFound to search "name==Group Links kind:group" in the incoming group of current database
				if (count of theFound) is 0 then
					set theGroupLinks to create record with {name:"Group Links", type:group} in the incoming group of current database
				else
					set theGroupLinks to item 1 of theFound
				end if
				
				-- Finding or creating the bookmark
				set theFound to search "name==" & GroupName & " url==" & GroupURL & " kind:bookmark" in theGroupLinks
				if (count of theFound) is 0 then
					set theLink to create record with {name:GroupName, URL:GroupURL, type:bookmark} in theGroupLinks
					delay 3
				else
					set theLink to item 1 of theFound
				end if
				set thePath to path of theLink
				
				-- Creating the recent item in Trickster
				tell application "Trickster" to add recent thePath source AppName displayPath GroupLocation callbackURL GroupURL bundleID "com.devon-technologies.think3"
				
			end if
		end repeat
	end tell
end performSmartRule

Since the script uses a workaround, which creates bookmarks pointing to groups, these bookmarks won’t show up in the default Folders category in Trickster. But it’s possible to set up a custom filter.

If anyone has further insights on tracking DevonThink groups in Trickster, I would be very interested. This works pretty well, but it remains a workaround.

// edit: Note that the script is triggered when a group is selected in the main view (not sidebar). It also doesn’t always trigger when double-clicking a group.

2 Likes