It turns out that the problem was that I had the Finder window list set to sort by the Kind column. Spotlight apparently does not like that arrangement, and refuses to display results. I had to sort by Name, close the window, and reopen it. Now Spotlight works perfectly.
This problem was originally with Snow Leopard, and persisted on Lion 10.7.0, but seems to have been fixed at some point before Mountain Lion 10.8.4.
A Finder alias (not a symlink) will be added to spotlight, if it's sitting in a visible folder, like Applications.
You can create them programmatically using AppleScript (use osascript
to integrate with other shell scripts.)
To create an alias use make alias file to {file to alias} at {destination of alias}
.
By default (ie. if destination isn't specified) the alias is created on the current user's Desktop, ie. ~/Desktop
.
Here's an example script to create an alias of a file in /Applications
set target_app to POSIX file "/usr/path/to/app"
set alias_dest to POSIX file "/Applications"
tell application "Finder"
make alias file to target_app at alias_dest
end tell
By the way, osascript
accepts input from stdin, so to run an AppleScript in a shell script, using a heredoc will work. It may make it easier for you to setup the target file better:
#!/bin/bash
TARGET=/usr/path/to/app
osascript <<EOS
set target_app to POSIX file "$TARGET"
set alias_dest to POSIX file "/Applications"
tell application "Finder"
make alias file to target_app at alias_dest
end tell
EOS
Best Answer
Send yourself an email from the iPhone to your iPhone email address
Yes seriously. I know that sounds absurd, but sending your iOS device an email actually makes Spotlight search start working again. All you need to do is send yourself an email to whatever mail account is setup on the iOS device, and once the new email is detected by iOS Mail app (as indicated by a Notification or the new mail chime), suddenly Spotlight works again.