Copy and manage search results directly from the Spotlight menu

SpotlightIconXIf you need to find a document, program, or other file on your hard drive, then you can do so quickly by opening the Spotlight menu located at the far right of your menu bar and typing keywords to perform a search. In addition, Spotlight supports several other services like calculator functions, where you can type “5 + 6,” for instance, and get 11 as the result.

When you click any of the search results that are presented in this menu, OS X will attempt to open them in a program that is set to handle them (ie, Calculator will open if you press Return after entering a calculation, and Preview or Adobe Reader will open if you press Return on a PDF file); however, you can also use other means to access the results of your search.

Drag and Drop

After performing a Spotlight search, you can drag any resulting file from the Spotlight menu to a window of another application (or onto the application’s icon in the Dock or Finder), to have a reference to this file be used by that application. In this manner, you can copy a file from Spotlight to an open folder in the Finder simply by dragging it from the menu to this location. You can also hold Option and Command while doing this to create an alias of the dragged file in the location you drop it.

In addition to managing files and folders in the Finder, you can drag items to open documents to embed them or otherwise handle them in ways that program is built. Otherwise, you can drag the file or folder to the system’s Open and Save dialogue boxes, which will point the box at the location of the file (and in the case of Save dialogue boxes, have the saved file name be set to the name of the dragged file.

If you are a Terminal user, the you can also quickly reference files in this way, by dragging them from the Spotlight menu to the Terminal window, where a full path to the file will be input at the point of the cursor.

Copy and Paste

Spotlight search results in OS X

Any of these search results can be dragged off the menu to a program or location, or they can be selected with the arrow keys and copied with Command-C.

In addition to drag and drop, you can use the system’s Copy command, and then paste the results at a location of your choosing. The ability to copy a selection in the Finder and then paste it elsewhere can be convenient, since you do not need to keep the source and destination windows open at the same time, and you can do so likewise with the Spotlight menu. Simply perform a search in Spotlight, and then navigate the Spotlight menu (ie, press the down arrow key) until your desired item is highlighted, and press Command-C to copy.

This action will copy a reference to the file or folder, which you can then paste in various ways to make use of it. These can include the following:

  1. Copy an image and then press Command-N in Preview to create a new image from the clipboard data.
  2. Paste the copied file to a new location in the Finder (which can also be revealed through Spotlight).
  3. Paste the item in the Terminal to input a full path to it at the point of the cursor.
  4. Embed the copied document as an attachment in an E-Mail or in another document type (Word, Pages, TextEdit, etc.).

This feature is not only useful for handling documents and folders you have searched for, but can also be used to handle results of Spotlight calculations. If you perform a calculation, such as the 5 + 6 = 11 result mentioned above, by pressing Enter you will open the Calculator application, but this application will show a value of 0 instead of inheriting the calculation done in the Spotlight menu. However, you can simply highlight the calculated Spotlight search result (it should be highlighted by default), and then press Command-C, and the result of the calculation should then be the copied data.

This slight augmentation can make Spotlight searches far more useful, especially for those who prefer the speed or primarily using the keyboard for entering data and managing their Macs. For instance, if you wish to move a file from your Desktop to your Documents folder, you do not have to use your mouse even once, and instead can perform the following steps:

  1. Command-Space to open Spotlight.
  2. Search for the file (even just the first few letters of its name should work).
  3. Press Command-C with the file highlighted.
  4. Press Delete to remove the old search and now search for Documents.
  5. Highlight the Desktop folder result and press Enter to open it, or you can simply press Command-Tab to switch to the Finder, and then press Shift-Command-O to open the Documents folder.
  6. Press Command-V to copy the file to this location, or press Option-Command-V to move it.