On Aug 24, 2009, at 1:29 PM, Joel Esler wrote: It does take a while for Spotlight to index a drive. Traditionally, the spotlight icon in the top right will have a "dot" in the middle of the magnifying glass. That poses a problem. I am currently experimenting with a script that moves files over 30 days old into a sparsebundle. The steps are: 1. If necessary, create a large sparsebundle; 2. Mount the sparsebundle's image disk; 3. Copy new files into the image disk, delete the originals; 4. Eject the sparsebundle's image disk.
This script is working very successfully, but, I want to be able to Spotlight search the image disk. So, I add the step ... 2.5 Enable indexing with 'do shell script "mdutil -i on volumepath" ';
Now the problem is that I need a new step 3.5 that checks if indexing is in progress and waits until it is finished before continuing to step 4. As far as I know, there is no way to do this. 'mdutil -s' only returns the status 'enabled' or 'not enabled', there is no 'completed' or 'in progress' status for indexing.
Any ideas?
|