I created a Keyboard Maestro script is designed to automate the process of (1) Verifying and Repairing Database (Shift-Cmd-Y), Checking File Integrity (Ctrl-Sift-Cmd-Y), Optimizing Databases (Shift-Cmd-K). To start process, select the top DevonTHINK database, and press “Run.” Repeat sequentially through all open databases. Below is a screenshot of this process.
(1) Is there a way of performing this kind of script inside of DevonTHINK using native commands?
(2) It is possible to have each step wait until the previous step has finished?
As my Keyboard Maestro script currently stands, I have inserted 1.5 second delay between each step, while allowing a full five seconds pause before running the last step which invokes an “Optimize Database command.” Several of my DevonTHINK databases are so large that it takes longer than 5 seconds to check the file integrity, so the last step is skipped and I must manually enter (Shift-Cmd-K) to optimize the database.
Verify and optimize are verbs in DT’s scripting dictionary, as is “check integrity”. So why go through all these steps instead of calling them directly from a script? Especially as GUI scripting is messy and not robust.
Thanks so much for your replies. I looked through the Scripts menu but MISSED the Scripts > Data sub-dir that containd exactly what I was looking for. I looked through Joe Kissel’s book on DT3 but didn’t find much that would help me with scripting. Do you have any suggestions on where I can turn to learn more about automating from within DT3?
And then there’s the manual with its section on “Automation”.
Thanks! I have Sal Soghoian’s book on AppleScript 1-2-3, and have muddled-my way through several chapters, and have adapted several scripts to be useful in my workflow. But, still. . . I am very much a beginner. ChatGPT has been helpful in suggesting some bash scripts that have also been useful in automating terminal commands. I worked my way through MacSparky’s fieldguide on DT. After 45 years in the Win/Tel world, I jumped ship three years ago, diving head first into macOS, and have not looked back. Goodbye Word—Hello Markdown. If I had been aware of DevonTHINK sooner, I would not have waited so long! It is an amazing way of storing and accessing all my files.
If you’re happy with AS, use it. I find it terribly verbose and tedious to write.
I am curious about the use case? What is it about your databases – or. your concerns about DEVONthink – that would require automating the triggering of these infrequently-used commands on a regular basis?
(Consider also, that the hours spent trying to figure out how to automate a sequence of commands adds up to more time than actually clicking the menu commands themselves over the course of a year or more. Not everything needs automation. Of course, “because I can” is an inarguable rationale LOL.)
My concerns over file integrity go back several months to when I have having problems syncing my databases with an iPad and iPhone DTTG via CloudKit. They would get out of sync, and files would go missing, etc. If I added web-clippings via DTTG, they sometimes would not show up in DT, and vice versa. I had to completely delete DTTG from both devices, and start over several times, until I realized (from reading this forum) that the problem was likely caused by CloudKit. When I switched to syncing via Bonjour over a local network, all those problems went away. As a precaution, I have continued to verify the file integrity of my twelve DT databases, but (honestly) have experienced ZERO syncing issues in recent months. I wanted an automated way of performing this verification, instead of manually performing the three step process on each on the twelve separate databases. Knowing that I can use Scripts > Data command to perform this task is much easier than the manual or Keyboard Maestro approach. Thanks for all the help, guys! Yours, Mark
I’ll mention, as a testimony, that in the last 17 years I have never needed to check or verify the integrity of the 6+ DEVONthink databases that have been open for 90% of that time. The reliability of this product is far greater than any other.
(Certainly better than iCloud, which was probably designed in a pre-school class project )
This is pretty remarkable. Do you use indexed folders at all? I agree wholeheartedly that DEVONthink is amazingly robust, but even I have had my share of failed integrity checks and having to rebuild databases. This disturbs me when it happens, and recalling past occasions, I think it usually involves files stored or edited outside of DEVONthink. Reading that someone has never needed to do it is making me wonder what I’m doing wrong …
I just can’t get over this :-). I’m sorry to pester you with more questions, but do you also synchronize the databases with other devices or computers? If so, which sync method(s) have you used all this time?