Another folder sorta like INBOX

Shockingly, I use DEVONthink to save lots of important documents. One mode of operation is to print a document to a PDF (or save it to a PDF) in the INBOX folder. It then goes into my Global Inbox and then I can file it somewhere.

But depending on what projects are active there are usually one or two Group in the database that a lot of my PDFs end up getting moved to. I would love to be able to skip a step and directly save the PDF to one of those folders.

It seems to me that I could create a folder in the finder, say PROJECT-X (or maybe PROJECT-X and PROJECT-Y), and set up a Hazel rule that runs an AppleScript or a Shortcut (I have never looked to see if DT supports Shortcuts), and thus achieve my goal. It would move the file to the specified Group and delete it.

But before I go do that I am thinking that it would be easier and save time if somebody has done this already. :slight_smile:

Thanks.

I do this a lot.
Make a finder folder for Project X
Index this folder into a database where that material is destined to end up.
That finder folder now appears as a group in DEVONthink terms.
Set up a DT smart rule (no need for Hazel in this instance) so that anything that ends up in the indexed group gets “moved into the database” and then moved to your ideal destination group.

While you’re at it put that finder folder in to the sidebar of the finder window so it’s easy to drop things there.

Things you may want to watch out for:
The “move into database” means it will be no longer in the finder folder but in DTs database folders.
If you’re scanning and doing OCR on the resulting file you might want to use an intermediate folder so the import doesn’t happen mid scan.

I’m sure others will weigh in with more technical advice and corrections but that’s the gist.

Three non-scripted options…

  • You could set the Settings > Files > Import > Destination to Select group.

  • You could also favorite a group and user DEVONthink’s Sorter to drop into it.

  • Create a smart rule targeting the Global Inbox and use a Move smart action to move matching documents to a specific group.

Or continue to use the Inbox
and set up a Smart Rule that runs an Applescript

Several good ideas here. Thanks!

These are all great ideas! I always learn something new here on the DT forums.

This isn’t exactly what you asked, but an adjacent use-case. Often it’s not just that I want to move it into one of a few specific groups, but I know exactly which group I want it to go to and there are many such groups (too many to “Favorite”). This only works on the Mac, but when you use DEVONthink’s Sorter they added a feature for dynamic search in the location drop down. Now with just a few keystrokes typing the destination group name it rapidly zeros in on the correct group and I can very rapidly file it exactly where I want. That one feature is something I appreciate every day.

2 Likes

This is pretty easy to do with an AppleScript in your Hazel rule. All you need to do is substitute the appropriate group name OR use the group UUID in the script below, in which case you’d comment out UUID line and uncomment the line above it:

-- Launch DEVONthink if it isn't already open.

tell application "System Events"

	if not (exists process "DEVONthink") then​ 		
         tell application id "DNtp" to activate

	end if

end tell



-- Import the file.

tell application id "DNtp"

	--set dest to get record at "/Statements” in database “Bills"

	set dest to get record with uuid "[redacted]"

	import (POSIX path of theFile) to dest

end tell

My Hazel rule looks like this, where the embedded script is what is above:

PS: If you use Keyboard Maestro, I have a KM macro that generates the above AppleScript when executed on a group in DEVONthink

Excellent. I haven’t tried applescripting Devonthink yet but I assumed that it would look something like this. Thank you!