You can use the command-line program
mdfind as a complete substitution for the Spotlight GUI. Accessing results is a bit inconvenient, though.
You can, using a little GUI scripting, open a
Finder window, and perform a Spotlight search there.
For this to work, you need support for assistive devices in System Preferences » Universal Access and Full Keyboard Access in System Preferences » Keyboard » Keyboard Shortcuts.
/Applications/Utilities/AppleScript Editor.app, and enter the following script:
on run argv # we expect program arguments
tell application "Finder"
activate # focus Finder
tell application "System Events"
keystroke "f" using command down # press Cmd-F
keystroke (item 1 of argv) # enter the program argument into search box
key code 36 # press enter
key code 48 # press tab
keystroke " " # press space
The steps "press tab" and "press space" are only necessary if you have not specified Search This Mac in Finder » Preferences » Advanced -- then we tab&select the This Mac option in the Finder search window.
Now save as Script, and execute from Terminal like this:
osascript spotlight.scpt test
What happens then looks somewhat like this:
The "Spotlight" action for Automator is probably not a good idea, since it runs until all results are available. Combined with Reveal Finder Items is a great way to see what opening 10,000 Finder windows looks like.
Other options, as always, are using applications such as LaunchBar, Alfred or Butler to initiate Spotlight search or provide an alternative UI.