Any scripting genius have a script that does a two-way sync between Devonthink and Dropbox? That means:
move new files in Devonthink to external folder in Dropbox
update the indexing of all files and folders in Dropbox
…preferably script is triggered automatically.
Variations on this have been discussed before. This script, posted in 2012, doesn’t appear to work anymore:
tell application id "com.devon-technologies.thinkpro2"
set theRecord to the first item of (the selection as list)
if the kind of theRecord is not "Group" then error "Please select a group"
deconsolidate record theRecord
synchronize record theRecord
on error errorMessage
display dialog errorMessage
This request will be redundant when the new syncing tech is powering DTTG 2.0, but experience tells me not to wait for it. I’m not a fan of DTTG 1x, so a DIY Dropbox solution seems the best bet - if it can be done.
DEVONthink now automatically synchronizes index groups. The action your want is “deconsolidating”, which means transfering internal documents to the indexed folder and thus making them indexed. Or, as the DEVONthink dictionary puts it:
Here’s a triggered script that can be attached to any indexed group, it will deconsolidate. I wrote the older script you mention in the OP, but it no longer works because DEVONthink was upgraded and “synchronize” was deprecated years after I posted the first thread. “Synchronize” will also not operate in a triggered script any longer.
tell application id "DNtp"
deconsolidate record theRecord
I suspect you are attempting to create a folder action script, when this script is a triggered script in DEVONthink. You want to follow the directions in the first post in this thread to attach the script to the indexed groups in the database.
Greg - no, I’ve set it up for a triggered script. Nothing is being triggered. I’ve tried to run the script manually, too, with no result.
The right-click “Move to external folder” command works perfectly, though.
In the thread you pointed to, there was this comment:
…leaving me somewhat confused. Does “indexed documents” refer to indexing one-way, as in Devonthink indexing folders it’s been pointed to, or does it mean two-way, and it also (supposedly) automatically shifts new files in DT to the external folder?
I’d certainly like to see this capability if it doesn’t already exist.
Here’s the set up. Dragged “Eureka” into the test group, clicked the group, and the script triggered and deconsolidated. As you can see, “Eureka” is now indexed.
You have to click a group name to trigger a triggered script – they don’t operate on their own without the click. You could write a script to trigger itself every x-seconds, but that’s just uselessly burning memory cycles.
Yes, but you have to click the parent that has the script attached. I just tried this – in Dropbox, made a child group in my test group. Sync’d in DEVONthink. Added a document in that child (a RTF created in DEVONthink), clicked the parent (where the triggered script is attached). The hierarchy deconsolidated, as expected.
I just tested korm’s script and it works beautifully.
When attached to an Indexed group (via the Script field in the group’s Info panel) it is triggered when that group is selected/opened and moves non-Indexed items (including those in subgroups) out to the appropriate external folder, then Indexes them back into the DEVONthink database.
Neat. Of course, it’s not limited to folders Indexed from a Dropbox location. Can be a useful tool for those who do Index captures and wish to keep corresponding Finder folders in concert with the database contents of Indexed groups.
That might be a clue. I’ve seen cases where replacing one triggered script with another doesn’t take. Try removing the triggered script, closing then reopening the database, and adding back the script I posted.
I thought the problem might be that I keep my DTPO databases on a second drive I installed in the MacBook DVD bay when I upgraded with an SSD. I moved my main database across to the SSD, deleted the files I’d indexed in DTPO and reindexed them, restarted the laptop and then re-attached the script …
Then I rebuilt the database, deleted the script, restarted Devonthink, re-attached the script … still nothing.
The “Move to external folder” command works like a charm, indexing from Drobox>Devonthink ditto, but the “deconsolidate” script doesn’t take files from Devonthink>Dropbox. And that’s about where I’ve stopped.
I deleted the script I’d been trying unsuccessfully to use, re-copied and re-compiled Korm’s script above, saved it to the ~/Library/Scripts/Devonthink folder (the earlier script was in the ~/Library/Application Support/Devonthink/Scripts folder), re-attached it to the Dropbox-linked folder in Devonthink … and voila! It worked.
No idea which of these steps cured the problem, but it all now Works As Advertised. Thanks for your support.