Subscribe to MacYourself via RSSFollow MacYourself on Twitter

Copy the path to a file or folder using Spotlight’s search box

Copy the path to a file or folder using Spotlight\'s search box

Ever wanted to grab the file path of an item in Finder so you could paste it somewhere for reference? There are a ton of twisted and backwards ways to do it — or you could try out this simple hint!

This is a tip I just discovered today, so hopefully it will bring just as much joy to you as it did to me. Mac OS X offers a number of ways to find out where a certain file or folder is located — Finder’s Path Bar and the Get Info window, to name a couple — but it doesn’t let you copy and paste the file path. That sure makes it difficult to tell people where to find things. Usually I just end up looking at the Path Bar and typing it all out manually. But alas, there is an easy (and kind of cool) way to copy a file path with the help of Spotlight!

  1. Navigate to the file or folder of your choice using Finder.
  2. Using one hand, click and hold that file/folder with your mouse. With the other hand, press Command+Spacebar on the keyboard to open Spotlight in the menu bar.
  3. Still holding the mouse button down, drag your file/folder to the Spotlight search box. Release the mouse when you see the green plus (+) icon. The file path will appear in the search box.
  4. Since the file path is already pre-selected, press Command+C to copy it to your Mac’s clipboard.
  5. Paste the file path in an email message, text document, or any other place you may need it.

There is one thing worth mentioning… if you complete step 2 and find text already sitting in Spotlight’s search box, simply press Delete before moving on to step 3. It technically doesn’t matter if it’s there or not since only your file path will be selected after you drag it. Just something to consider.

While some other approaches to copying a file path involve 3rd party software or special configuration beforehand, this method only requires two hands and some basic finger work. Elegant and straightforward — just the way Mac users like it.

10 Comments Have Been Posted (Leave Your Response)

Nice. Thank you!

Thanks you!

Great tip, and explained well! Thanks loads, mate.

Great tip although its not really an elegant solution. its really rather clunky. An elegant solution would be right/control click a file and have a “Copy file path” option.

Awesome! Been using QuickSilver to achieve this, but this might even be simpler! Those hidden tricks… thanks!

Great tip. Not sure why finder doesn’t show the full path in a similar way to Windows.

How handy. Thanks for that!

This is “elegant and straightforward?” I hope you were being sarcastic there. A five-step, two-handed process just to copy a simple folder path?

I’m no fan of windows, but at least that OS has for many years offered a selectable path bar that is easily enabled in any folder view.

Great, but how can you make the path active when you copy and paste into a message? Crazy that this is not available!!

If you want to paste the path into a message (or any other application), you can simply drag the icon in the Finder window title bar right into the window where you want to paste it. No need to use the clipboard at all for that.