Is there any way to programmatically add a folder to Spotlight's "Privacy" tab? Either through Terminal or Applescript?
Often I want to click on an item in Spotlight results in Finder, and have that item's folder no longer be indexed.
I found that if you
sudo defaults read /Volumes/foo/.Spotlight-V100/VolumeConfiguration.plist Exclusions
you can see an array with all the items excluded.
But if you try to
sudo defaults write /Volumes/foo/.Spotlight-V100/VolumeConfiguration.plist Exclusions -array-add '/path/to/folder'
it does NOT get added to the Privacy tab in the Spotlight Preference Panel, nor does it get de-indexed.