Created
August 22, 2013 07:45
-
-
Save foo9/6304230 to your computer and use it in GitHub Desktop.
Copy POSIX Path to Clipboard
This file contains hidden or 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
| to joinList(aList, delimiter) | |
| set retVal to "" | |
| set prevDelimiter to AppleScript's text item delimiters | |
| set AppleScript's text item delimiters to delimiter | |
| set retVal to aList as string | |
| set AppleScript's text item delimiters to prevDelimiter | |
| return retVal | |
| end joinList | |
| on run {input, parameters} | |
| tell application "Finder" | |
| set posixPaths to {} | |
| set theItems to selection | |
| repeat with itemRef in theItems | |
| try | |
| set end of posixPaths to POSIX path of (itemRef as text) | |
| end try | |
| end repeat | |
| set the clipboard to my joinList(posixPaths, "\n") | |
| end tell | |
| return input | |
| end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment