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: bretperry on Jan 27, '10 01:40:31PM

Cool. And works great in most cases, but not for BASH if the Mac file path includes a slash. I know, shouldn't use slashes but we're in a big company and Mac lets you put a slash in File + Folder names, so people do...

This works OK for Forward slashes and back-slashes in the Mac Filename (quotes whole path):

on run {input}
set input to POSIX path of input
set input to "\"" & input & "\""
return input
end run

then add a copy to clipboard action
Maybe someone knows a more elegant way to do this in a shell script?





[ Reply to This | # ]