Skip to content

Instantly share code, notes, and snippets.

@foo9
Created August 22, 2013 07:45
Show Gist options
  • Select an option

  • Save foo9/6304230 to your computer and use it in GitHub Desktop.

Select an option

Save foo9/6304230 to your computer and use it in GitHub Desktop.
Copy POSIX Path to Clipboard
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