The script will not wait for indexing to finish before continuing, which is a good thing since a timeout required for Sherlock to finish indexing large volumes would be huge and required if a script starts the process and waits for a response to the event.
I have discovered that the application process “Sherlock” takes the command ‘index containers’ and launches another application process called “Find by Content Indexing” to actually do the indexing, so it is possible to monitor that process and continue only after it’s finished and has quit.
One way to do this is, right after telling Sherlock to index, write a repeat loop that checks the Finder for the process “Find by Content Indexing” and exit the repeat when it’s not there. However, this can get ugly, chew up processor cycles, and destroy any shred of AppleScript dignity.
Instead, I’d recommend downloading Sleep Commands osax. With it you can, among other things, have a script go to ‘sleep while running application “Find by Content Indexing”’ which should do the trick. Might have to pause (delay) the script right after telling Sherlock to start indexing to give the Indexing app enough time to show up in the Finder’s process list.
: I use Retrospect to backup the computer each night after I leave.
: The script handles the backup and then shuts down the
: computer. I would like to add indexing via Sherlock to the
: script. My question, will the script wait for the indexing to
: finish BEFORE executing the quit command? I have not done any
: tests on this myself, I was curious if anyone knew the answer
: before I modified my script.
: Thanks, Brad Bumgarner