Created
November 30, 2014 03:26
-
-
Save LeoHe09/696f264b957ea44ab002 to your computer and use it in GitHub Desktop.
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
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 & POSIX path of (e as text) & return | |
end repeat | |
set the clipboard to theList | |
else if (count of sel) is equal to 1 then | |
set the clipboard to POSIX path of (sel as text) | |
else | |
set the clipboard to POSIX path of (target of window 1 as alias) | |
end if | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello LeoHe09,
I found your script here and was super grateful as it's exactly what I was looking for. thanks!
one small question though: I've been trying to remove a certain part of the output string. the top folder names.
but can't get it working. was trying this function ..
can you help? thanks a lot :)
on findAndReplaceInText(theText, theSearchString, theReplacementString)
set AppleScript's text item delimiters to theSearchString
set theTextItems to every text item of theText
set AppleScript's text item delimiters to theReplacementString
set theText to theTextItems as string
set AppleScript's text item delimiters to ""
return theText
end findAndReplaceInText