Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Shared on Facebook

Shop at Amazon

Ad

OSXDaily on Facebook

Search spotlight

Get Quick Dictionary Definitions From Anywhere in Mac OS X with Spotlight

May 14, 2012 - 5 Comments

Instant dictionary from Spotlight in Mac OS X

While you can immediately access a dictionary definition by three-finger tapping on a single word in Mac OS X or double-tapping in iOS, the Mac also provides another instant dictionary option: Spotlight.

Yup, the good old Spotlight desktop file search also doubles as a full fledged dictionary access point, this is perfect for when you quickly want the definition of a word that is either in your head or just not written on the screen to access from the tap method. To use the Spotlight dictionary:

  1. Hit Command+Spacebar to bring up Spotlight
  2. Type the word you want to define and it will show up in the Spotlight search results labeled as “Look Up”
  3. Hover over the word to see a Quick Look window including the definition

If you click on the word or hit the Return key you will launch the Dictionary app with the definition, though that isn’t necessary as the hover option is very fast.

This isn’t just a Lion and Mountain Lion feature though, it even works in Mac OS X Snow Leopard though the nicer Quick Look hover option doesn’t exist and instead you’ll see an older style popup.

Preview & Watch Videos Directly in Spotlight

Apr 13, 2012 - Leave a Comment

Watch or Preview Video and Movies in Spotlight

From Mac OS X Lion and onward, videos and movie files can be previewed and played directly in the Spotlight search results menu. To try this out for yourself:

  1. Hit Command+Space and search for a movie or video file
  2. Hover over the video search result until the thumbnail preview pops up to the left
  3. Hover over the thumbnail to find a “Play” button

This isn’t really a viable option to watch a long video, but it is extremely useful to quickly locate a specific video or a scene within some movie file without opening a ton of individual files into QuickTime Player.

A similar feature lets you play videos directly in a Finder window, that feature works in Mac OS X 10.6 and earlier as well.

Drag & Drop from Spotlight in Mac OS X

Apr 6, 2012 - 8 Comments

Drag and drop from Spotlight

You can drag and drop files directly from Spotlight to elsewhere in the OS X Finder. To try it out, use Command+Space to search for something, then click and hold on the item while dragging it out of the Spotlight menu.

Default behavior moves the file from it’s source location to the new destination, but if you hold own the Option key during the process you can make a copy of the file instead. To undo the location change, hit Command+Z.

This can be much faster than digging around in the file system to locate a document or folder manually, especially with files buried far within subfolders. OS X Lion or later is required to use drag and drop in Spotlight.

11 Must-Know Spotlight Keyboard Shortcuts

Mar 9, 2012 - 13 Comments

Spotlight icon Spotlight is Mac OS X’s powerful built-in search engine. Not only will it find just about any file or folder buried on your drives, but it also doubles as a fantastically quick application launcher. If you aren’t using Spotlight on a regular basis yet you really should start doing so, and with that in mind here are 11 helpful keyboard shortcuts to get the most out of Mac search feature.

4 Basic Spotlight Shortcuts

These are the most basic shortcuts to use Spotlight:

  • Open Spotlight menu – Command+Space
  • Open Spotlight in the Finder – Command+Option+Space
  • Clear Spotlight search box – Escape
  • Close Spotlight menu – Escape twice

7 Spotlight Usage & Navigation Keyboard Shortcuts

These shortcuts are for interacting and navigating within Spotlight search results:

  • Open first search item – Return
  • Navigate search results – Arrow Up and Arrow Down
  • Open to location of first search item in Finder – Command+Return
  • Get Info on search item – Command+I
  • Show Quick Look Preview of Spotlight results – Command key or hover with the Mouse cursor (OS X 10.7 and later only)
  • Show path/location of search result – Command+Option while hovering over search result
  • Jump categories in search results – Command+Arrow Up or Command+Arrow Down

Remember these tips and you’ll be mastering Spotlight in no time!

Don’t forget that you can use search operators to improve results by looking only for specified file types or dates, and more. We have plenty more Spotlight tips if you’re interested too, check them out.

Reindex Spotlight from the Command Line

Feb 2, 2012 - 5 Comments

Spotlight Spotlight is generally very good at keeping a valid index of a drives contents up to date, but if you’ve recently restored a drive or had to delete the Spotlight index for one reason or another, you may need to reindex the drive manually. This is easy from the Spotlight control panel, and can also be achieved through the command line as we’ll demonstrate.

Reindexing Spotlight from the Command Line

Reindexing Spotlight from the command line is done with the mdutil tool, first launch Terminal and then type:

sudo mdutil -E /

This will reindex every mounted volume on the Mac, including hard drives, disk images, external drives, etc. Specific drives can be chosen by pointing to them in /Volumes/, to only rebuild the primary Macintosh HD:

sudo mdutil -E /Volumes/Macintosh\ HD/

To reindex an external drive named “External” the command would be:

sudo mdutil -E /Volumes/External/

Use of the mdutil command will spin up mds and mdworker processes as Spotlight goes to work.

Individually Reindexing Selected Files
In rare cases, Spotlight can miss a file during index, so rather than reindex an entire drive you can also manually add an individual file to the search index with the mdimport command:

mdimport /path/to/file

The mdimport command can be used on directories as well.

Stop Spotlight from Indexing Time Machine Backup Volumes & External Drives

Jan 24, 2012 - 4 Comments

Stop Spotlight from Indexing Time Machine Drives

The default behavior for Spotlight is to start indexing any drive as soon as it’s connected to a Mac, a task that can take a very long time with larger volumes. The problem is that for larger external backup drives and Time Machine volumes, you don’t necessarily want it indexed by Spotlight. This is particularly true if the drive gets used on multiple machines, where indexing on each Mac isn’t necessary.

The solution is simple enough, the same method used to exclude something from Spotlight can also be used to stop Spotlight from indexing a Time Machine drive or other external volume:

  1. Connect the volume you want excluded to the Mac, even if Spotlight is currently indexing
  2. Launch “System Preferences” and click on “Spotlight” followed by the ‘Privacy’ tab
  3. Drag the drives icon into the Privacy window

Even if the drive is currently being indexed by Spotlight, this will cease the indexing process and prevent the drive from being reindexed again on that Mac. You’ll have to redo this process on each Mac that the drive is connected to.

If a drive is removed from the privacy list, it will automatically start a rebuild of the Spotlight index for that volume, however.

Stopping Spotlight from Indexing Backups & External Drives from the Command Line

If you’d rather prevent a drive from being indexed from the command line, you can do that with mdutil and the following syntax:

mdutil -i off /Volumes/VolumeName

When the command has executed properly, you’ll see something like this:

$ mdutil -i off /Volumes/MediaCenterMovies
/Volumes/MediaCenterMovies:
Indexing and searching disabled.

Be sure to specify a full volume path, because if you just use / or don’t use proper syntax you could wind up disabling Spotlight systemwide.

Reversing this and reenabling indexing on a per volume basis is just a matter of changing the flag from off to on:

mdutil -i on /Volumes/VolumeName

Again you’ll get a message, this time confirming the path and “Indexing enabled.”

Rebuild the Spotlight Index

Jan 17, 2012 - 5 Comments

Rebuild the Spotlight Index

Do you need to rebuild the entire Spotlight index on a Mac? It’s easy to do, but can take a while. Here’s how to start the reindexing process of an entire drive using the Spotlight control panel:
Read more »

How to Exclude Hard Drives and Folders from Spotlight Index in Mac OS X

Dec 30, 2011 - 7 Comments

Exclude drives and folders from Spotlight index

Spotlight is a wonderful feature of Mac OS X, but sometimes you don’t want it indexing everything. Whether it’s an external backup drive, a scratch disk, or just a private folder with files you don’t want easily found, excluding drives and directories from Spotlight is easy:

  • Launch System Preferences from the  Apple menu and click on “Spotlight”
  • Click on the “Privacy” tab
  • Drag & drop folders or drives to exclude from the Spotlight index, or click the “+” plus icon in the corner to manually select hard drives or directories

Anything folder or drive in that list is effectively hidden from the Spotlight index, making the contents not appear in file searches.

Exclude items from Spotlight index

This is a much better approach than disabling Spotlight if all you want to do is hide certain files from prying eyes.

If at any point you want these items to be reindexed and reincluded within Spotlights search results, all you need to do is highlight them in the privacy tab and delete them with the Delete key or by hitting the “-” minus button in the lower left. Removing items will trigger the mds and mdworker processes to run.

On a side note, because excluding items and then reincluding them also causes that directory or drive to be completely reindexed, this can be a helpful troubleshooting tip if you’re running into location specific problems with Spotlight.

Hide the Spotlight Menu Icon in Mac OS X Lion

Dec 12, 2011 - 15 Comments

Hide the Spotlight icon in OS X Lion

Whether you are disabling Spotlight or just wanting to reduce menubar icon clutter, it’s possible to hide the Spotlight icon. Here’s the best part though; if you just want to hide the Spotlight menu, you can do so without disabling the search abilities from functioning in the Finder or with other apps that rely on the Spotlight metadata.

Hide the Spotlight Menu Icon in OS X Lion

This does not disable Spotlight or mds, it only hides the icon from the menubar.

Launch the Terminal from /Applications/Utilities/ and type the following:

sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search

Next, you kill a process called SystemUIServer to refresh the menubar and have the change take effect:

killall SystemUIServer

What you’ll find is the Spotlight menu is removed, but the search abilities built into Finder still work as seen in the screenshot showing the “Searching This Mac” window, accessible with Command+F :

Hiding the Spotlight menu still allows search to work

Show the Spotlight Menu Again

Getting the Spotlight icon back is a matter of bringing the permissions back to their default setting:

sudo chmod 755 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search

Follow this up with killing the SystemUIServer again:

killall SystemUIServer

The Spotlight menu will be visible again:

Show the Spotlight icon again

Thanks to Juan for the tip via comments.

How to Disable (or Enable) Spotlight in Mac OS X Lion

Dec 10, 2011 - 27 Comments

Disable Spotlight in OS X Lion

Completely disabling and reenabling Spotlight in Mac OS X Lion can be done with the help of the Terminal. The following command unloads the Spotlight mds agent from launchd, preventing the daemon from running or indexing any drives entirely.

Open up the Terminal (found in /Applications/Utilities/) and enter the following commands based on the need to either disable or reenable Spotlight indexing. This will effect indexing on all drives connected to the Mac.

Disable Spotlight

The primary method is using launchctl, this will require the administrative password:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Another approach is to use the older indexing method of “sudo mdutil -a -i off” which turns off indexing only, but more on that in a minute.

Reenable Spotlight

The guaranteed way to reenable Spotlight is to reload it into launchd using launchctl:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Again, the alternate approach is the indexing related “sudo mdutil -a -i on” command, but that method can throw the “Spotlight server is disabled” error and not allow you to turn it back on. If you run into that problem, use the sudo launchctl load command instead to enable both indexing and Spotlight.

With Spotlight reloaded launchd, the mds agent will immediately start running again to reindex the filesystem. Depending on the amount of changes and new files since the last time MDS ran, this can take a while. You can verify that MDS is running through Activity Monitor or by pulling down the Spotlight menu to see an “Indexing Drive Name” progress bar.

Enable Spotlight in OS X Lion