Publishers of technology books, eBooks, and videos for creative people

Home > Blogs > Mac Productivity: Quick Scripts and Workflows - Sharing File and Folder Paths

Mac Productivity: Quick Scripts and Workflows - Sharing File and Folder Paths

By  Mar 19, 2012

Topics: Apple, Operating Systems, Productivity

If you work in an office, the odds are good that you have shared locations for files and folders.  Your office might have a Projects share, for example, where you keep project folders and related files.

Suppose you need to direct your buddy John to a specific file in one of these project folders?  What’s the easiest way to do it?

Well, you could type out directions to the file, such as Company Projects > Active Projects > 2012 > March > Some Project > Some Folder > Some Other Folder > Some File.  Of course, this takes time.  A few seconds here and there doesn’t sound like a lot, but it all adds up.  There’s also a lot of back and forth, looking at the file and going back through its parent folders, trying to figure out its exact path.  It’s easy to make a mistake, typing a folder name incorrectly, making it difficult for John to follow your roadmap and find the file in question.  Maybe you could open up the folder in list view, expand the folders down to the file, take a screenshot, and email it to John?  What a hassle.  There has to be an easier way.

There is.  A simple Automator workflow can do the work for you, copying the paths of selected files and folders to the clipboard, so you can quickly and easily send them to John.  Here’s how you do it...

1. Launch Automator (in /Applications)

2. When prompted to choose a type of workflow, select Service and click Choose

Creating an Automator Service workflow

3. Set the popup menus at the top of the workflow area to receive files or folders in Finder

Setting the Service workflow to appear when files or folders are selected in the Finder

4. Search for the Copy to Clipboard action, and drag it to the workflow area.  When you do this, you’ll see that the action “links up” with the top of the workflow area.  This tells you that the action will receive input.  When the workflow runs, any selected files or folders in the Finder are passed to this action as input, for processing.  It won’t copy the files themselves, just their paths.

The completed workflow, which receives files and folders as input

5. Save the workflow, and name it Files and Folders • Copy Paths of Selected Items

Saving the workflow

You’re done.  To test the workflow, go to the Finder and select a file or two.  You can then trigger the workflow in one of two ways.

Option 1: From the Finder menu, choose Services > Files & Folders • Copy Paths of Selected Items.  This menu is also accessible from the Action (that little gear icon) menu in an opened window’s toolbar, provided the toolbar is visible.

Triggering the workflow from the Finder’s Services menu

Option 2: Right+Click or Control+Click on the selected files or folders.  From the Finder’s contextual menu, choose Services > Files & Folders • Copy Paths of Selected Items.

Triggering the workflow from the Finder’s contextual menu

The workflow runs and copies the paths of the selected items to the clipboard.  You can now paste them into an email, document, or anywhere else, to send to John.

A copied path, pasted into an opened Mail message

For more on AppleScript and Automator, check out my book  Automator for Mac OS X: Visual QuickStart Guide, as well as my video podcast series Mac Automation Made Simple.