Created
February 27, 2014 10:55
-
-
Save EddyRespondek/9248057 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on run {input, parameters} | |
set output to {} | |
repeat with f in input | |
set f to replace(POSIX path of f, "/Volumes/", "afp://myserver/") | |
set f to replace(f, " ", "%20") | |
set end of output to f | |
end repeat | |
set text item delimiters to linefeed | |
set the clipboard to (output as text) | |
end run | |
on replace(input, search, replace) | |
set text item delimiters to search | |
set ti to text items of input | |
set text item delimiters to replace | |
ti as text | |
end replace |
Thanks for this. In Automator, I selected Service receives selected [ files or folders ] in [ any application ]
, and it works fine with items selected in Path Finder as well as Finder. I needed the actual POSIX path, but with spaces escaped, so I used:
set f to replace(POSIX path of f, " ", "\\ ")
That gives paths that can be used at the command line (e.g., with ls
).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
works well, thank you! quick question:
*dropbox-path:*
/Users/Name/