If you search for something that opens Preview.app (e.g. a PDF file) in Spotlight, the application not only opens the file but actually copies the Spotlight query into the application's search field (for deeper search). iPhoto and Mail.app also do this.
This is a really nice feature. Unfortunately, Apple does not document how it's implemented. Opening a document from Spotlight appears to simply send application:openFile
to the application delegate. Is it possible to retrieve the user's Spotlight query somehow? Or is this a hardcoded feature of Spotlight?