A dashboard (not only) for DEVONthink

Interesting, thank you @pete31. I bought SuperTab a while back and tried it for a couple months then deleted it. Maybe I’ll try again. I’ve never had much joy from the so-called “improved Docks” like SuperTab. Maybe I’m too thick to understand how best to use them ̅\_(ツ)_/ ̅

I have tried SuperTab too a few years ago but for some reason I deleted it. Yes the rows are convenient but there was something missing or not fulfilling, back then I didn’t have DevonThink. Might give it a try one more time.

Version 3

What:
Create bookmarks for selected DEVONthink records, ask for Tags, make tagged bookmarks available in SuperTab.
Delete selected bookmarks (if the indexed group is the current group).
Control which existing bookmarks are available in SuperTab by changing their flagged status. No need to delete.
Control which Tags (additionally to all Tags of flagged bookmarks) should be always prepopulated in choose from list by manually assigning Tags to any record that is not a bookmark - as long as this record is flagged and in the indexed group its Tags are used.

Setup:
in Finder: Create a new folder (I’ve put mine in SuperTabs Application Support folder),
in DEVONthink: Index the new folder
in this script: Set the UUID of the indexed group
in SuperTab: Hover over the bottom of a row, click the plus sign, select “Tagged Items” from the drop-down menu, select a tag.

Usage:
Run on selected records outside the indexed group to make them available in SuperTab.
Unflag records inside the indexed group to temporarily deactivate them.
Assign Tags to any record that is not a bookmark inside the indexed group to additionally prepopulate choose from list. Unflag this record to temporarily deactivate it.
Run on selected bookmarks inside the indexed group to delete them.
SuperTab supports multiple rows of Tagged Items and it supports multiple Tags in one row.
This script also supports multiple tags, so one bookmark, e.g. a database inbox, can be used in different SuperTab setups.
Choose existing Tags and create a new Tag in one script run.
Change properties as you like

Don’t know where I got the handler from sorry

Happy dashboarding!

-- Version 3
-- What:
-- Create bookmarks for selected DEVONthink records, ask for Tags, make tagged bookmarks available in SuperTab. 
-- Delete selected bookmarks (if the indexed group is the current group).
-- Control which existing bookmarks are available in SuperTab by changing their flagged status. No need to delete.
-- Control which Tags (additionally to all Tags of flagged bookmarks) should be always prepopulated in choose from list by manually assigning Tags to any record that is not a bookmark - as long as this record is flagged and in the indexed group its Tags are used.

-- Setup: 
-- in Finder: Create a new folder (I’ve put mine in SuperTabs Application Support folder), 
-- in DEVONthink: Index the new folder
-- in this script: Set the UUID of the indexed group
-- in SuperTab: Hover over the bottom of a row, click the plus sign, select "Tagged Items" from the drop-down menu, select a tag.

-- Usage: 
-- Run on selected records outside the indexed group to make them available in SuperTab.
-- Unflag records inside the indexed group to temporarily deactivate them.
-- Assign Tags to any record that is not a bookmark inside the indexed group to additionally prepopulate choose from list. Unflag this record to temporarily deactivate it.
-- Run on selected bookmarks inside the indexed group to delete them.
-- SuperTab supports multiple rows of Tagged Items and it supports multiple Tags in one row. 
-- This script also supports multiple tags, so one bookmark, e.g. a database inbox, can be used in different SuperTab setups.
-- Choose existing Tags and create a new Tag in one script run.
-- Change properties as you like

-- Happy dashboarding!

property theUUID : "" -- UUID of the indexed group
property createNewTag : "Create new Tag ..." -- title of first choose from list item
property usePrefix : true -- if true they will have it even if overwritten in the dialog
property prefixTag : "A Dashboard for " -- keeps the tags together
property showSuperTab : true -- if true SuperTab is right there to add or change a row

tell application id "DNtp"
	try
		set windowClass to class of window 1
		if {viewer window, search window} contains windowClass then
			set currentRecord_s to selection of window 1
		else if windowClass = document window then
			set currentRecord_s to content record of window 1 as list
		end if
		
		set theGroup to (get record with uuid theUUID)
		
		set theBookmarks to children of theGroup whose type is bookmark
		repeat with thisBookmark in theBookmarks
			if thisBookmark's state is false then
				consolidate record thisBookmark
			else
				deconsolidate record thisBookmark
			end if
		end repeat
		
		if current group = theGroup then
			
			if currentRecord_s ≠ {} then
				
				tell application "System Events" to set activeApp to name of first application process whose frontmost is true
				tell application "SystemUIServer"
					activate
					set theDialog to display dialog "Delete selected bookmarks?" buttons {"Cancel", "Ok"} default button 2 with title "SuperTab Dashboard"
				end tell
				activate application activeApp
				
				if button returned of theDialog = "Cancel" then return
				
				repeat with thisRecord in currentRecord_s
					if item 1 of parents of thisRecord = theGroup then
						if thisRecord's type = bookmark then
							try
								consolidate record thisRecord
							end try
							delete record thisRecord in theGroup
						end if
					end if
				end repeat
				
			end if
			
		else
			
			if currentRecord_s = {} then
				display notification "Please select something"
				return
			end if
			
			set theChildren to children of theGroup whose state is true
			set activeTagsList to {}
			repeat with thisChild in theChildren
				set thisTags to tags of thisChild
				repeat with i from 1 to count of thisTags
					set thisTag to item i of thisTags
					if thisTag is not in activeTagsList then
						set end of activeTagsList to thisTag
					end if
				end repeat
			end repeat
			set sortedActiveTagsList to my sort_list(activeTagsList)
			set theTagList to (createNewTag as list) & sortedActiveTagsList
			
			tell application "System Events" to set activeApp to name of first application process whose frontmost is true
			tell application "SystemUIServer"
				activate
				set chooseTag to choose from list theTagList default items createNewTag with prompt "Create new and / or choose existing Tag(s):" with title "SuperTab Dashboard" with multiple selections allowed
			end tell
			activate application activeApp
			if chooseTag is false then return
			
			
			if item 1 of chooseTag = createNewTag then
				
				tell application "System Events" to set activeApp to name of first application process whose frontmost is true
				tell application "SystemUIServer"
					activate
					if usePrefix = false then set prefixTag to ""
					set theDialog to display dialog "New Tag:" buttons {"Cancel", "Ok"} default button 2 default answer prefixTag with title "SuperTab Dashboard"
				end tell
				activate application activeApp
				
				if button returned of theDialog = "Cancel" then return
				set theTag to text returned of theDialog
				if theTag = "" then return
				if usePrefix = true and theTag does not start with prefixTag then set theTag to prefixTag & theTag
				if (count of chooseTag) > 1 then
					set chooseTag to items 2 thru -1 of chooseTag
					set theTag to (theTag as list) & chooseTag
				end if
				
			else
				
				set theTag to chooseTag
				
			end if
			
			repeat with thisRecord in currentRecord_s
				set theName to name of thisRecord
				set theURL to reference URL of thisRecord
				set theBookmark to create record with {name:theName, URL:theURL, type:bookmark, tags:theTag, state:true, exclude from classification:true, exclude from search:true, exclude from see also:true} in theGroup
				deconsolidate record theBookmark
			end repeat
			
			if (count of chooseTag) = 1 then
				display notification (item 1 of theTag) with title "Available in SuperTab Dashboard"
			else
				display notification (item 1 of theTag) & space & "and more..." with title "Available in SuperTab Dashboard"
			end if
			
		end if
		
		set thePath to path of theGroup
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink Pro" & space & error_number message error_message as warning
	end try
end tell


tell application "Finder"
	set theFolder to (POSIX file thePath) as alias
	set theFiles to files of theFolder
	repeat with thisFile in theFiles
		set extension hidden of thisFile to true
	end repeat
end tell


if showSuperTab = true then
	tell application id "com.spritec.supertab"
		presentInterface
	end tell
end if


on sort_list(theTagList)
	set old_delims to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {ASCII character 10}
	set list_string to (theTagList as string)
	set new_string to do shell script "echo " & quoted form of list_string & " | sort -f"
	set new_list to (paragraphs of new_string)
	set AppleScript's text item delimiters to old_delims
	return new_list
end sort_list

Isn’t fun to watch a project like this evolve? That’s part of the beauty of automation in general, and AppleScript in specific (as it’s typically easy to read and understand what’s going on). :slight_smile:

1 Like

All thanks to DEVONthink and the great people behind it. Thanks! :smiley:. One should be aware of what a fascinating forum this is. Before I started to use DEVONthink I’ve never heard of AppleScript. Boooom. Don’t get me wrong, I’m far from really knowing what I do (as you know @BLUEFROG :wink:) but if things work out the way I want I learned it here. Always a smile on my face when I remember how I didn’t follow @korm s advice to consider Keyboard Maestro which (of course) would have been the best solution. Keyboard Maestro is now on shift + ctrl + k :smile:

1 Like

Glad to hear it!

Version 3.1

You can now use DEVONthink 3 icons in SuperTab which makes it easier to tell what kind of DEVONthink 3 record it is.

To use this download this command line tool (it’s Donationware), save it somewhere and set the path in the script.

As mentioned in earlier posts SuperTab supports splitting of rows and the usage of more than one tag in a row so don’t get the example screenshot wrong - it’s not that limited. You are not limited to use only groups in one row and smart groups in another, the screenshot is just a very basic example.

And, this could turn out to be very handy, SuperTab supports shortcuts to activate not only SuperTab but a specific row. However it does not seem to be possible at the moment to open the currently selected file when the shortcut is released. I wasn’t aware of this feature but can imagine that this could turn out to be something like an app switcher for DEVONthink records. This would be pretty cool

And this is worth mentioning, SuperTab seems to be able to run AppleScript files (but I didn’t test it).

To add inboxes or global smart groups (thanks @cgrunenberg!) just copy the Reference URL via the menu, create a new bookmark in the indexed group an assign a tag).

Hope it’s useful :slightly_smiling_face:

-- Version 3.1
-- What:
-- Create bookmarks for selected DEVONthink records, ask for Tags, make tagged bookmarks available in SuperTab. 
-- Delete selected bookmarks (if the indexed group is the current group).
-- Control which existing bookmarks are available in SuperTab by changing their flagged status. No need to delete.
-- Control which Tags (additionally to all Tags of flagged bookmarks) should be always prepopulated in choose from list by manually assigning Tags to any record that is not a bookmark - as long as this record is flagged and in the indexed group its Tags are used.
-- NEW: use DEVONthink 3 icons for group, smart group or document

-- Setup: 
-- in Finder: Create a new folder in Finder (I’ve put mine in SuperTabs Application Support folder), 
-- in DEVONthink: Index the new folder
-- in this script: Set the UUID of the indexed group
-- in SuperTab: Hover over the bottom of a row, click the plus sign, select "Tagged Items" from the drop-down menu, select a tag.
-- NEW: if you want to use the DEVONthink 3 icons in SuperTab download this tool https://www.hamsoftengineering.com/codeSharing/SetFileIcon/SetFileIcon.html (it's Donationware) and set the variable "SetFileIconPath"

-- Usage: 
-- Run on selected records outside the indexed group to make them available in SuperTab.
-- Unflag records inside the indexed group to temporarily deactivate them.
-- Assign Tags to any record that is not a bookmark inside the indexed group to additionally prepopulate choose from list. Unflag this record to temporarily deactivate it.
-- Run on selected bookmarks inside the indexed group to delete them.
-- SuperTab supports multiple rows of Tagged Items and it supports multiple Tags in one row. 
-- This script also supports multiple tags, so one bookmark, e.g. a database inbox, can be used in different SuperTab setups.
-- Choose existing Tags and create a new Tag in one script run.
-- Change properties as you like

-- NOTE that the default prefixTag has changed. Change it to the one you want.

-- Happy dashboarding!

property theUUID : "" -- UUID of the indexed group
property createNewTag : "Create new Tag ..." -- title of first choose from list item
property usePrefix : true -- if true they will have it even if overwritten in the dialog
property prefixTag : "." -- keeps the tags together and on top of the SuperTab Tag list
property showSuperTab : true -- if true SuperTab is right there to add or change a row
property SetFileIconPath : "" -- path where you've saved the command line tool "SetFileIcon" (the tool is only necessary if you want to see DEVONthink 3 icons in SuperTab. If you don't want to use them leave it as "")

tell application id "DNtp"
	try
		set windowClass to class of window 1
		if {viewer window, «class srwi»} contains windowClass then
			set currentRecord_s to selection of window 1
		else if windowClass = document window then
			set currentRecord_s to content record of window 1 as list
		end if
		
		set theGroup to (get record with uuid theUUID)
		
		set theBookmarks to children of theGroup whose type is bookmark
		repeat with thisBookmark in theBookmarks
			if thisBookmark's state is false then
				consolidate record thisBookmark
			else
				deconsolidate record thisBookmark
			end if
		end repeat
		
		if current group = theGroup then
			
			if currentRecord_s ≠ {} then
				
				tell application "System Events" to set activeApp to name of first application process whose frontmost is true
				tell application "SystemUIServer"
					activate
					set theDialog to display dialog "Delete selected bookmarks?" buttons {"Cancel", "Ok"} default button 2 with title "SuperTab Dashboard"
				end tell
				activate application activeApp
				
				if button returned of theDialog = "Cancel" then return
				
				repeat with thisRecord in currentRecord_s
					if item 1 of parents of thisRecord = theGroup then
						if thisRecord's type = bookmark then
							try
								consolidate record thisRecord
							end try
							delete record thisRecord in theGroup
						end if
					end if
				end repeat
				
			end if
			
		else
			
			if currentRecord_s = {} then
				display notification "Updated indexed Folder!"
				return
			end if
			
			
			set theChildren to children of theGroup whose state is true
			set activeTagsList to {}
			repeat with thisChild in theChildren
				set thisTags to tags of thisChild
				repeat with i from 1 to count of thisTags
					set thisTag to item i of thisTags
					if thisTag is not in activeTagsList then
						set end of activeTagsList to thisTag
					end if
				end repeat
			end repeat
			set sortedActiveTagsList to my sort_list(activeTagsList)
			set theTagList to (createNewTag as list) & sortedActiveTagsList
			
			tell application "System Events" to set activeApp to name of first application process whose frontmost is true
			tell application "SystemUIServer"
				activate
				set chooseTag to choose from list theTagList default items createNewTag with prompt "Create new and / or choose existing Tag(s):" with title "SuperTab Dashboard" with multiple selections allowed
			end tell
			activate application activeApp
			if chooseTag is false then return
			
			
			if item 1 of chooseTag = createNewTag then
				
				tell application "System Events" to set activeApp to name of first application process whose frontmost is true
				tell application "SystemUIServer"
					activate
					if usePrefix = false then set prefixTag to ""
					set theDialog to display dialog "New Tag:" buttons {"Cancel", "Ok"} default button 2 default answer prefixTag with title "SuperTab Dashboard"
				end tell
				activate application activeApp
				
				if button returned of theDialog = "Cancel" then return
				set theTag to text returned of theDialog
				if theTag = "" then return
				if usePrefix = true and theTag does not start with prefixTag then set theTag to prefixTag & theTag
				if (count of chooseTag) > 1 then
					set chooseTag to items 2 thru -1 of chooseTag
					set theTag to (theTag as list) & chooseTag
				end if
				
			else
				
				set theTag to chooseTag
				
			end if
			
			set setDelay to false
			tell application "Finder" to set DEVONthinkPath to POSIX path of (application file id "DNtp" as alias)
			
			repeat with thisRecord in currentRecord_s
				set theName to name of thisRecord
				set theURL to reference URL of thisRecord
				set theBookmark to create record with {name:theName, URL:theURL, type:bookmark, tags:theTag, state:true, exclude from classification:true, exclude from search:true, exclude from see also:true} in theGroup
				deconsolidate record theBookmark
				
				if SetFileIconPath ≠ "" then
					set setDelay to true
					set thePath to path of theBookmark
					
					set theClass to class of thisRecord
					if theClass is in {parent, smart group} then
						if theClass = parent then set iconPath to DEVONthinkPath & "/Contents/Resources/Group.icns"
						if theClass = smart group then set iconPath to DEVONthinkPath & "/Contents/Resources/Smart-Group.icns"
					else
						set iconPath to DEVONthinkPath & "/Contents/Resources/dtRecord.icns"
					end if
					do shell script quoted form of POSIX path of SetFileIconPath & " -image " & quoted form of POSIX path of iconPath & " -file " & quoted form of POSIX path of thePath
				end if
				
			end repeat
			
			if SetFileIconPath ≠ "" then
				tell application id "com.spritec.supertab"
					quit
					delay 0.5
					activate
				end tell
			end if
			
			if (count of chooseTag) = 1 then
				display notification (item 1 of theTag) with title "Available in SuperTab Dashboard"
			else
				display notification (item 1 of theTag) & space & "and more..." with title "Available in SuperTab Dashboard"
			end if
			
		end if
		
		
		set thePath to path of theGroup
		
	on error error_message number error_number
		if the error_number is not -128 then display alert "DEVONthink Pro" & space & error_number message error_message as warning
	end try
	
end tell


tell application "Finder"
	set theFolder to (POSIX file thePath) as alias
	set theFiles to files of theFolder
	repeat with thisFile in theFiles
		set extension hidden of thisFile to true
	end repeat
end tell


if showSuperTab = true then
	if setDelay = true then delay 1.5
	tell application id "com.spritec.supertab"
		presentInterface
	end tell
end if


on sort_list(theTagList)
	set old_delims to AppleScript's text item delimiters
	set AppleScript's text item delimiters to {ASCII character 10}
	set list_string to (theTagList as string)
	set new_string to do shell script "echo " & quoted form of list_string & " | sort -f"
	set new_list to (paragraphs of new_string)
	set AppleScript's text item delimiters to old_delims
	return new_list
end sort_list

I just looked at SuperTab, which I had not seen before, and it does seem a bit overwhelming – in that it fills up the screen with a lot of stuff. I think I prefer the approach taken by this guy: https://youtu.be/QA56xMRCl4s who uses KeyBoard Maestro and BetterTouchTool to create palettes for all sorts of applications. It seems to me to be far more flexible and configurable – though admittedly it requires two utilities. Since I already had both of them, there was no extra cost to me, but I like the complete control the user has over what to put on a palette. It is worth mentioning that the video linked above is in German – which I don’t understand – but it is so clear I didn’t really have a problem following it. Just another example of what can be done with utilities to ease workflows.

The URL you posted, I was gonna ask for the English version.

I have similar approach when choosing labeling with BTT I use one gesture for 4 different action that are similar, like choosing highlight colors on pdf

Try this, which is in English: https://community.folivora.ai/t/using-btt-gestures-to-control-the-keyboard-maestro-macros-actions-etc/4911

Cheers.

1 Like

Thank you.

Hi mbbntu, first off I’m afraid I couldn’t make clear enough what I actually use SuperTab for (possibly because english is not my first language).

You’re right, SuperTab fills the screen but that is exactly what it’s built for and it does this only until you’ve clicked the item that you want - you activate it and it will automatically disappear after you’ve chosen something or click on the desktop. That’s normal app behaviour.

And you’re right in that it seems to be possible to do a variety of different things with SuperTab. After I first read about it I visited the website to see if there’s something interesting for me and yes, it was overwhelming. I first didn’t know where to place this app and it seemed that it can do nothing more than the apps I already use (which is not bad at all and in no way something thats speaks against SuperTab).

But then, in the long list, was this one feature that got my attention, which is by the way a very happy accident as I normally never use tags and don’t read further when they are topic. This feature is called “Tagged Items” and it makes all files that share a given tag available in SuperTab. SuperTab consists for us users of rows and if you set such a row to this feature “Tagged Items” you can choose which tag (the files who share this tag) you want to see when you activate SuperTab.

So there is

  • the app SuperTab which can show all files for a given tag.
  • there is DEVONthink which supports tags and which can be used with indexed files.
  • there is a script from korm which exports selected DEVONthink records as a bookmark to the Finder.

I didn’t actually used korms export script to built the script which is the topic of this thread - but without it I would never have been attracted by reading “Tagged Items”. I just would have had no idea that it is possible to integrate DEVONthink records with the Finder. And as mentioned before I normally don’t use tags and I don’t use them today - besides of the necessary usage in this specific script.

What my script does is building a bridge for DEVONthink 3 records to SuperTab. And as SuperTab is (besides a lot of other things, which you described as overwhelming - and I got a similiar impression) an app launcher it’s super easy to open those “exported” DEVONthink records, they are just a keystroke or a mouse move away.

It’s always good to know of other possibilities, which is why I went and checked out SuperTab, but I’ve just looked at my system, and I have 5,419 tagged files, with 291 tags. I don’t think SuperTab would be a lot of help to me with that lot!! Personally, I use Leap if I have to work with tags a lot, or else I do it inside DEVONthink. Incidentally, that does not include the bookmarks I have on Pinboard, which are also mostly tagged, so that is another 1,100 tagged items, and a similar number of tags, most of which are the same as on my system. Once you get into tagging, it is easy to build up huge numbers of tagged items, and a large number of tags.

All the best,
Martin.

Martin, if you want to find out if the script could be something for you I think you test it. As mentioned I don’t use tags beside this script, so I really can only think what could work. I see no problem in prefixing tags that you want to use with SuperTab. In fact thats exactly what I do, but of course this can not be a guide for you with so much tags. Did you try the script? As mentioned I can imagine that it’s not always clear what I want to say. If this is the case or you’ve found something else please let me know.

Your video has exactly nothing to do with this thread. I don’t write this in anger or the like but I think this must be clearly stated for other users.

This thread is about DEVONthink records and how some of them (not your entire databases…) could be made accessible outside of DEVONthink. The whole thing is meant as an easy to reach accessing point for records (groups, smart groups or single records) that you need at a given time. If you had read this thread you would not have found that much to misunderstand. It’s really remarkable how I entered this thread again some hours ago and how I have to leave it now.

However, if other users have suggestions, questions or whatever, I’m open to it.

Well, the title of the thread is “A dashboard (not only) for DEVONthink”. I therefore assumed the thread was supposed to be about dashboards, a concept that has interested me for a long time. (And here I take “dashboard” to mean broadly a way of getting quick access to items that interest you, usually presented in some sort of group, as icons, or perhaps a list.) It was the word “dashboard” that sparked my interest. I confess I have something of a weakness for this sort of thing, and I’ve lost count of the number of “solutions” I’ve tried over the decades – including DragThing, FinderPop, Fresh, Liquid – you name it, I’ve tried it. You can even achieve something of this sort using Gladys, or Dropzone, which is a utility that I use a lot. In recent times I was simply tagging files with “status:urgent”, “status:pending” and so forth, and using smart folders (both inside and outside DEVONthink) to keep track of those items. It worked pretty well. As to the video, well it is possible to use the method to create a dashboard for quick access to individual items inside DEVONthink. Here is a screenshot of one that I created in a couple of minutes this morning.

The last three items on the palette are items inside a DT database, accessible via item links, and clicking on them will open them in DT. Any item that can be linked can be placed on the palette. Not only that, you can even put actions or menu items on the palette, or even chain them together. The other items are there because I added the new ones to a pre-existing palette. Some of them launch two different applications and position the windows to my taste. The palette appears on my screen when I make a three-finger swipe on my trackpad. Granted, this is not a way to deal with large numbers of bookmarks, but personally I would not want more than a few items on a dashboard because in my view that would defeat its purpose. If I did want a large number of bookmarks, I would probably use the tagging and smart folder method, or I might use Tinderbox to watch a DT folder. Since I keep my DT databases indexed with SpotLight, I can use that, or HoudahSpot, to find tagged items inside a DT database very quickly. It is even possible to use Alfred to do the same thing.

I certainly intend no disrespect for the solution @pete31 has offered to the problem of creating dashboards – on the contrary. Indeed I looked at it, and even installed SuperTab temporarily, to see if it could work for me. I regret that it doesn’t suit my purposes, which is no reflection on the quality of the script. It is merely the case that I have different needs. If I mentioned the system I use, it was only in case it might be of interest to others – which it may well not be. I used to be a teacher, and it is natural to me to want to share knowledge. But we all work in different ways, and each of us has to find their own solutions. I believe that discussion of other options can help us to find one that works for us.

All the best,
Martin.

Personally, I prefer to use Alfred to search my databases instead of creating a dashboard. But if I do need to have some items readily accessible I use a macro called Spotlight Search Prompt for Keyboard Maestro to create a list of the items I need with their attached links.

E.g.:

If anyone is interested I can give further information.

About SuperTab, I had tried it before but found it was not for me.

Hi Bernardo – thanks for mentioning that – I see it’s one of Dan Thomas’s extraordinary efforts https://forum.keyboardmaestro.com/t/macro-spotlight-search-prompt/4665. I already use KMFAM. I’ll certainly give it a try. And nice to see that the Alfred workflow for searching is being updated for DT 3. I found it on Git. More strings to our bows, which is good. Or, as the English say, “there is more than one way to skin a cat”. Thanks again.

1 Like

In case you’re trying to run the script I posted in this thread you’ll find that it doesn’t work in DEVONthink 3.6.

That’s due to DEVONthink’s new handling of “invalide arguments”. After the release of DEVONthink 3 I decided to continue to use “search window” in scripts so that DEVONthink 2 users could use them in, well, search windows. With version 3.6 that’s not possible anymore.

If you want to use the script you’ll have to replace this voluminous block …

set windowClass to class of window 1
if {viewer window, search window} contains windowClass then
	set currentRecord_s to selection of window 1
else if windowClass = document window then
	set currentRecord_s to content record of window 1 as list
end if

… with this neat line …

set currentRecord_s to selected records

… which does what the six lines have done. Wow, that’s great! :smiley:

To make it compatible to version 2 you could use selection instead of selected records.