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.
.metadata_never_index
doesn't work on Mojave, then how can we disable indexing on a whole volume? (not just a single dir) – Óscar López Jul 31 '20 at 18:27.metadata_never_index
at the root was enough, it behaves like a folder. I don’t know what to do now :-/ – Óscar López Jul 31 '20 at 20:29