Apple - Easy way to copy paste file paths on Macs

I think this is an option that will do exactly what you want. Using your Serial Number.jpg example, do as follows:

  1. In the Finder browse to the image called “Serial Number.jpg” located on Server1
  2. Right-click on the file to display the context menu
  3. Now press and hold the option key down
  4. Select the Copy “Serial Number.jpg” as Pathname option
  5. Now go to the procedure you’re editing and paste the pathname you just copied

This should result in your document having the /Volumes/Server1/Serial Number.jpg path pasted into it.

Just use the same steps for any file, regardless of whether it’s stored locally, on an external drive, or on a server. This also works to get the file path of folders.

Keyboard shortcut

Thanks to Mateusz Szlosek for pointing out you can also use a keyboard shortcut. Instead of Steps 2 to 4 above, once you've selected the file you can use the option+command+C shortcut to copy the file path. Then you can paste it as usual.

Windows etc files

There are custom built utilities to format shares for other operating systems and sub/afp as well:

  • PathSnagger 2 works very well for this

You can just drag & drop a file [or a whole swathe of them] into a text area to get its [their] path[s] - not in all apps but in many, including Terminal [& incidentally in the question/answer space on Stack Exchange too.]

Some apps, like BBEdit, do not support this and take the contents of the file insteat of the full path. For these apps a Command 'drag & drop' works as well.


I would preferable just drag & drop a file into a text area to get its path (see Tetsujin's answer)

If this does not work for you, consider writing a very small program in Qt.

From http://qtsimplify.blogspot.de/2013/01/drag-and-drop-files-into-your.html :

Create a new "Qt Gui Application" in Qt Creator.

Edit the header file, mainwindow.h, by adding the following headers:

#include <QDropEvent>
#include <QUrl>
#include <QDebug>

Reimplement the protected functions, dropEvent() and dragEnterEvent() protected:

void dropEvent(QDropEvent *ev);
void dragEnterEvent(QDragEnterEvent *ev);

In the mainwindow.cpp, add these lines:

void MainWindow::dropEvent(QDropEvent *ev)
{
    QList<QUrl> urls = ev->mimeData()->urls();
    foreach(QUrl url, urls)
    {
        qDebug()<<url.toString();
    }
}

void MainWindow::dragEnterEvent(QDragEnterEvent *ev)
{
    ev->accept();
}

The dropEvent() function is where you recover the name of all the files you drop into your application.

And lastly, add this line into your mainwindow constructor:

setAcceptDrops(true);

Then, e.g. if you want to have the paths in the clipboard, you only need to copy them there using QClipboard

QClipboard *clipboard = QGuiApplication::clipboard();
clipboard->setText(url.toString());

For single file drops, and a list for all files.