Created
July 17, 2014 15:07
-
-
Save lsfalimis/a6fdd9ca60735d1ee14d to your computer and use it in GitHub Desktop.
Copy the paths of Finder files and folders (HFS path)
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
(* | |
if select multiple items, copy paths of them with one in each line; | |
if select an item, copy its path; | |
if none is selected, copy the current folder path. | |
*) | |
tell application "Finder" | |
set sel to the selection | |
if (count of sel) is greater than 1 then | |
set theList to "" | |
repeat with e in sel | |
set theList to theList & e & return | |
end repeat | |
set the clipboard to theList | |
else if (count of sel) is equal to 1 then | |
set the clipboard to sel as text | |
else | |
set the clipboard to target of window 1 as text | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment