DTP 3 and Hazel have worked great for me. I download regular documents such as bank statements, Hazel recognizes them, grabs the date, and then renames with the reconfigured name and date utilizing this AppleScript:
tell application "Finder"
set _path to (the POSIX path of theFile as string)
set {_name, _extension} to {name, name extension} of theFile
-- optional: hide extension in Finder
set extension hidden of theFile to true
-- optional: remove extension for DEVONthink displays
set _name to text 1 thru -((count _extension) + 2) of _name
set _extension to "." & _extension
end tell
-- Launch DEVONthink if it isn't already open.
tell application "System Events"
if not (exists process "DEVONthink Pro Office") then
tell application id "DNtp" to activate
end if
end tell
-- Import the file.
tell application id "DNtp"
set theGroup to get record with uuid "7A72BA27-C302-4362-8B25-01ACEC1C1F9A"
-- choose one option, Index or Import, comment out the other
set theImport to import _path name _name to theGroup
-- set theIndex to indicate _path to theGroup
end tell
However, I have to go back to DTP 3 and find the group to confirm what was received. So I searched through the forums, found this: https://discourse.devontechnologies.com/t/applescript-to-go-directly-to-smart-group-tried-but-failed-is-it-possible/55461/6
and modified a bit, then added to the end of my current script:
tell application "Finder"
set _path to (the POSIX path of theFile as string)
set {_name, _extension} to {name, name extension} of theFile
-- optional: hide extension in Finder
set extension hidden of theFile to true
-- optional: remove extension for DEVONthink displays
set _name to text 1 thru -((count _extension) + 2) of _name
set _extension to "." & _extension
end tell
-- Launch DEVONthink if it isn't already open.
tell application "System Events"
if not (exists process "DEVONthink Pro Office") then
tell application id "DNtp" to activate
end if
end tell
-- Import the file.
tell application id "DNtp"
set theGroup to get record with uuid "7A72BA27-C302-4362-8B25-01ACEC1C1F9A"
-- choose one option, Index or Import, comment out the other
set theImport to import _path name _name to theGroup
-- set theIndex to indicate _path to theGroup
end tell
tell application id "DNtp"
set a to "x-devonthink-item://7A72BA27-C302-4362-8B25-01ACEC1C1F9A"
open tab for URL a in viewer window 1
end tell
So now, the renaming and dating occurs, the file is moved to the correct group, but a new tab is added to the front window, showing that group.
My aim is to have this final step occur in a new window. In other words, after the file is moved into DTP, the group in DTP to which it was moved opens in a new window.
I’m guessing its pretty simple, and I am a simpleton for not figuring it out. But thanks for any help in advance!