In Mavericks and prior, running the following script at startup would immediately remove the Spotlight icon from the menubar.
-- remove Spotlight icon (repairing disk permissions resets it to default)
if (do shell script "stat -f %Lp /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search") ≠"600" then
do shell script "chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search" password "mypassword" with administrator privileges
do shell script "killall SystemUIServer"
end if
In Yosemite, a reboot or logout/login is also required to remove the icon. It seems the do shell script “killall SystemUIServer” line is not having the desired effect. Any solution for this? Thanks.