• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Spotlight Indexing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Spotlight Indexing


  • Subject: Re: Spotlight Indexing
  • From: Axel Luttgens <email@hidden>
  • Date: Tue, 25 Aug 2009 14:11:33 +0200

Le 24 août 09 à 21:22, Luther Fuller a écrit :

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?

Hello Luther,

Perhaps could you rely upon the fact that, while you're indexing a volume, the mdworker process is regularly invoked for scanning the items on that volume.
The basic idea could thus be this one:


try
do shell script "lsof -a -c mdworker /Volumes/V16242-01"
on error
log "No file(s) currently opened by mdworker on /Volumes/ V16242-01."
end try


Of course, it may happen that no file is opened at the time the lsof command is executed even if the indexing process is still in progress; the above test should thus be put inside a loop (n consecutive tests, separated by time t, with no open files => indexing is done).

HTH,
Axel _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Spotlight Indexing
      • From: Luther Fuller <email@hidden>
References: 
 >Spotlight Indexing (From: Luther Fuller <email@hidden>)
 >Re: Spotlight Indexing (From: Joel Esler <email@hidden>)
 >Re: Spotlight Indexing (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Spotlight Indexing
  • Next by Date: Re: Spotlight Indexing
  • Previous by thread: Re: Spotlight Indexing
  • Next by thread: Re: Spotlight Indexing
  • Index(es):
    • Date
    • Thread