AppleScript Indexing Not doing anything

Hello, I am trying to use the applescript “Update Indexed Items of All Databases”. For as many files as I have indexed, approx 45,129, selecting that script flashes a box of some sort for an 8th of a second or less and apparently does nothing else. I am NOT an AppleScript expert. I know enough to open the Applescript and look at the code. I can make adjustments if I know what to do. Looking at the following line from that script I see:```
show progress indicator “Updating Indexed Items” steps (count of theDatabases)


Just to cover my bases I first did the “Verify and Repair” menu and then I did the “Rebuild Database” menu Item. No change in the results I have already decribed in updating the indexes. 

Any thoughts?

Thanks

Becasue I never got any dialog, becasue nothing happened after that quarter second. I don’t know what else to check? Open to suggestions?

I can check with tech support. Installation was by the book, not real complicated,
Setup assistant —> Install extras
Update Indexed Items - Install
Select in Applescript menu - Data —> Update indexed Items of all databases
Results I have already described, none

Attempt to fix:
Applescript menu —> Open Scripts Folder
Open script: “Update indexed items of all databases.scpt"```
– Update indexed items of all databases
– Created by Christian Grunenberg on Tue Mar 25 2014.
– Copyright © 2014. All rights reserved.

– Set to true if indexed items are not only located at the root of the database
property pAllRecords : 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


I have no idea why this works for you and not for me?

Nothing I can do to help.

Are all enclosing indexed groups located at the top level of the database? Otherwise you have to modify the script, see pAllRecords property.

I thought the purpose of the index ALL was that It would index … ALL levels? No? My one open database has Inbox at It’s top level - not the global Inbox. Then I have “- Projects Notes” where I keep all my new progress notes for each project. I place tags on them to place them in each smart folder needed. Inside that folder I have all my projects including Current Events, etc. So many are not at the top level.

I am not very good at writing Applescript.

I have my key folders indexed, each folder does contain sub-folders and files. More than one level usually. I have several smart folders, each focused on a project that I am working on. I have a CurrentEvents smart folder and anything that I review for today’s work gets a CurrentEvents tag for me to track for today. When I add or change any of my Macs folders I want to be sure the changes are also reflected in DTPO. That was the reason I Was asking, to make sure my workflow that I am now building does not accidentally get corrupt from not seeing new or changed files on my Mac outside DTPO.

As I recently mentioned in a new thread, It seems that what I put in or remove from a folder which is already indexed changes automatically - so long as that folder gets “touched”. IS that what the script is doing, “touching” all the folders already indexed?

No. All scripts are only executed on demand as long as they’re not attached to an item via the Info panel. But DEVONthink automatically updates indexed groups after opening/displaying them but without subgroups so that you don’t notice any delays usually.

OK, still not sure how to get the AppleSCript plugin to index all files on all levels? You suggested looking at pAllRecords. According to the following code and description, does this mean that if I change false to true I would be looking as deeply as needed in all folders when I ran that script?

Change this;

-- Set to true if indexed items are not only located at the root of the database
property pAllRecords : false

To this;

-- Set to true if indexed items are not only located at the root of the database
property pAllRecords : true

Yes?

ADDED: Tested this and It now shows a progress dialog with a progress bar. Runs for approx 2-3 minutes with a spinning beachball the whole time. No movement on the progress bar. Log shows many files were skipped. Is this normal? 45,174 files.

Indexing will skip files that the database doesn’t deal with. For example, by default DEVONthink does not index .app files. If you inspect the log and see files types that were skipped that you believe should not have been skipped, please post a note and we’ll see what we can do to help.

I see. Mostly no problem with what was skipped except … A couple of user manuals were skipped. Probably better if It indexes all PDFs.

Then the good news is that your suggestion worked. Even though the progress bar was not moving - you can never really tell with the spinning beachbal if It works or not, It did work. I found a couple of files in my my Current Events smart folder that had missed being reindexed earlier. Thanks.

If the PDFs open correctly in Preview or other PDF reader, then you could always send one of them to Support and they could advise you on why it doesn’t get indexed.

Thanks, I checked them out and sure enough, they were corrupt. Went with very old software too so I was happy to toss them out.