Retrieving Spotlight query used to open document in application
        Posted  
        
            by vicvicvic
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by vicvicvic
        
        
        
        Published on 2010-04-06T03:04:09Z
        Indexed on 
            2010/04/06
            3:13 UTC
        
        
        Read the original article
        Hit count: 294
        
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?
© Stack Overflow or respective owner