There is a relatively new script posted on the Support Assistant in the Scripts section “Update indexed Items of all databases”. This script will do what it says - update your indexed records in all open databases.
By default, the script will only update indexed records or groups that are located at the root (top) level of the database. In other words, it does not delve into groups to update indexed records that are in subgroups. There is a property setting in the script that can be set manually to change the default so that the script will look at all levels of a database for indexed records to update.
The script below adds a dialog to the front end of the process to prompt you whether you want to update all levels or not – this eliminates the necessity of changing the script and lets you decide on the fly how you want to proceed. Other than the dialog, the rest of the script does exactly what the Support Assistant version does.
-- Update indexed items of all databases
-- Created by Christian Grunenberg on Tue Mar 25 2014.
-- Copyright (c) 2014. All rights reserved.
-- Set to true if indexed items are not only located at the root of the database
property pAllRecords : false
set dScope to button returned of (display dialog "Index all records at all levels?" buttons {"Yes", "No", "Cancel"} default button 2 with title "Setting")
if dScope = "Yes" then set pAllRecords to true
if dScope = "No" then set pAllRecords to false
tell application id "DNtp"
try
set theDatabases to databases
show progress indicator "Updating Indexed Items" steps (count of theDatabases)
repeat with theDatabase in theDatabases
step progress indicator (name of theDatabase as string)
set theRecords to records of theDatabase -- Children of root
repeat with theRecord in theRecords
if pAllRecords or theRecord is indexed then
synchronize record theRecord -- Updates children of theRecord too
end if
end repeat
end repeat
hide progress indicator
on error error_message number error_number
hide progress indicator
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
end tell