Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.4: A simple way to copy the path to a file or folder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: A simple way to copy the path to a file or folder
Authored by: jetak on Sep 01, '09 05:40:30PM

In Snow Leopard the Automator plugin support has been changed so allanmarcus Automator script will no longer work, but it is easy to fix.

Snow Leopard has done away with the contextual menu plugin support and now calls them 'Services'. There is no longer a Save As -> Plug-in option in Automator. Now when you open Automator, choose the 'Service' template, then follow these instructions:

--------------------------Begin Script---------------------------
At the very top change the drop down lists so the look like:
Service receives selected 'files or folders' in 'Finder.app'

Select Finder & Folders
Drag Get Selected Files and Folders to the workflow (to position 1)

Select Utilities
Drag Run Shell Script to the workflow (to position 2)

Change pass input to as arguments
Change
echo "$f"
to
echo "'$f'"

Select Utilities
Drag Copy to Clipboard to the workflow (to position3)

Save
Call it something like 'Copy Path'
--------------------------End Script---------------------------

You now should now have a new item called 'Copy Path' in your Finder contextual menu (the right click menu).

I am having an issue when copying the directory path for a file. When I paste the results, it pastes two lines of the identical path. It is the correct path just copied twice. It only seems to do this to files and not folders and when I run the script in Automator it seems to work fine.

Other than that little issue this method seems to work great.

I also tried making this same Automator script into an app and then adding it to Services-> Services Preferences-> Application Shortcuts and then giving it a shortcut like opt-cmd-v but this did not work, though I have not really tried that hard.



[ Reply to This | # ]
Snow Leopard: A simple way to copy the path to a file or folder
Authored by: granolamike on Sep 04, '09 06:24:24PM

I get the same duplicate result when I use Copy Path in the contextual menu (created using Automator) with Snow Leopard.

Note in Snow Leopard you can just copy the path out of the Get Info box too.



[ Reply to This | # ]
10.4: A simple way to copy the path to a file or folder
Authored by: spamathon on Sep 28, '09 05:56:38PM

You're getting the duplicate folder list because you've forgotten to take out the first action (Get Selected Finder Items). You only need it to test the workflow in Automator - once you've finished testing, remove the first item so it just looks like:

(receives "files or folders" in "Finder.app")
V
Run Shell Script (add the ' ' so you get slashes instead of colons)
V
Copy to Clipboard

Done!



[ Reply to This | # ]