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


Click here to return to the '10.6: Create a Service to copy a file path URL to the clipboard' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.6: Create a Service to copy a file path URL to the clipboard
Authored by: broz on Mar 18, '10 10:43:00AM
This works, but always adds a newline to the end. This is VERY annoying when pasting into the Terminal, as it executes the command you're trying to create. I added at tr -d "\n" to the end
sed -e 's/:/\//g' -e 's/\ /\\ /g' -e "s/\\'/\\\'/g" -e 's/\"/\\"/g' | tr -d "\n" | pbcopy
which fixes that problem. This Automator command does nothing about the selection of multiple items in the Finder. All the paths get copied, and land in the clipboard. I don't want them all pasted into the Terminal, but might want them pasted somewhere else. In that case, the tr bit on the end will not be what you want.

[ Reply to This | # ]