Script to Verify & Repair all open databases

Does anyone have a script to run Tools > Verify & Repair on all open databases? :confused:

I’d like to run these operations more often, but it takes ages on my 9 separate databases. (Yes, I have Preferences > Backups set to Hourly.)


Run and check the Log. Run V&R from the menu to get a fuller message if errors are encountered. (The DEVONthink scriptable command “Verify” returns only a count of errors, not a verbose report of errors found.)

Verify all open databases
Review Log for results
Returns only a count of errors -- run V&R from the menu to get a fuller report

tell application id "DNtp"
	set theDatabases to every database
	repeat with thisDatabase in theDatabases
		set thisMsg to "Verified: " & the name of thisDatabase & " with result "
		set thisResult to verify database thisDatabase
		set thisLog to log message (thisMsg & thisResult & " errors and/or missing files")
	end repeat
end tell

:slight_smile: Thank you!