Hi there, triggered by this thread and especially this post I’ve found the following setup, thanks @ngan!
If you want to use a DEVONthink 3 database’s inbox inside the database part of the sidebar then that’s possible with a triggered script and/or a smart rule.
Don’t be scared off by “script”, it’s easy to set up and there’s also a helper script that creates the necessary “fake” incoming group and attaches the trigger script.
You don’t need to use the helper script it’s just for convenience, but then you have to create the “fake” incoming group manually and attach the trigger script to it. Also you don’t really need both together, a trigger script and a Smart Rule, but while trying and testing I created both and as I couldn’t get the Smart Rule alone to trigger in every case I ended up using both together.
Important: try this setup with a test database first!
To use an inbox (almost) as it was in DEVONthink Pro
- save the trigger script somewhere (you can use Script Editor.app)
- copy the path of the script (right click and hold the option key, this will change the context menu to “Copy path”
Trigger script
-- Move all records of incoming group to the fake incoming group you (or the second script..) attached this script to
on triggered(theRecord)
tell application id "DNtp"
try
set theRecords to every child of (incoming group of current database)
repeat with thisRecord in theRecords
move record thisRecord to theRecord
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell
end triggered
- paste the path into the helper script
- change the name of the “fake” incoming group to the desired one (you have to use the same name later in the Smart Rule)
- save the script somewhere, e.g. in DEVONthink’s script menu. (If you don’t want to add more databases or just want to test this setup then you don’t have to save it, it’s just for convenience)
Helper script
-- Create fake incoming group and attach trigger script that moves all records from the incoming group to this group
property triggerScriptPath : ""
tell application id "DNtp"
try
set theDatabase to current database
set theDatabasename to name of theDatabase
set theName to ".Eingang [" & theDatabasename & "]" -- change to desired name
set theGroup to create location "/" & theName & "/" in theDatabase
set attached script of theGroup to triggerScriptPath
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell
- create a Smart Rule with scope set to the database’s incoming group, kind:any or kind:group and paste the Smart Rule script as embedded script. I use “after import” as action.
- set the name of the database in the Smart Rule script (Important: Be careful when copying this Smart Rule, it’s easy to forget to change the database name…)
- set the group name (you’ve chosen in step 4) in the Smart Rule script
Smart Rule script
-- Move records from incoming group to fake incoming group
property theDatabaseName : "" -- BE CAREFUL WHEN COPYING A SMART RULE THAT USES THIS SCRIPT
on performSmartRule(theRecords)
tell application id "DNtp"
try
set theDatabase to database named theDatabaseName
set theChildren to (every child of (incoming group of theDatabase))
set theGroup to create location "/.Eingang [" & theDatabaseName & "]/" in theDatabase -- change to desired name
repeat with thisChild in theChildren
move record thisChild to theGroup
end repeat
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell
end performSmartRule
The Smart Rule should look something like this
Didn’t test much, but it works and I think I’ll use this as long as it’s not possible to change the name of an DEVONthink 3 incoming group (quite confusing sometimes…)