May 03, '10 07:30:00AM • Contributed by: Anonymous
Let's start with the launchd service. Open Terminal and type the following, then press Return:
$ cd ~/Library/LaunchAgents/Create the file com.index.no_index.plist with your favorite editor (vi, nano, etc.), and insert the following XML code:
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.index.no_index</string> <key>Disabled</key> <false/> <key>Program</key> <string>/Users/*YOUR_NAME*/no_index</string> <key>StartOnMount</key> <true/> <key>RunAtLoad</key> <false/> <key>KeepAlive</key> <false/> <key>EnableTransactions</key> <true/> </dict> </plist>
Now we create the actual script. Go to you home folder by typing cd ~ , and create a file named no_index with your favorite text editor, with these contents:
#!/bin/bash for filename in /Volumes/* do if [[ $filename != "/Volumes/Macintosh HD" && $filename != "/Volumes/BOOTCAMP" ]] then file=$filename"/.metadata_never_index" touch "$file" fi done;
I hope everything will work for you; for me, it works very well in Snow Leopard.
[robg adds: I haven't tested this one.]
