Created
April 13, 2011 21:32
-
-
Save brainsatwork/918469 to your computer and use it in GitHub Desktop.
applescript which copies current Finder path to clipboard.
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
-- click on icon | |
try | |
tell application "Finder" | |
set currentPath to (POSIX path of (target of front window as alias)) | |
set the clipboard to currentPath | |
end tell | |
on error | |
my finderErrorMsg() | |
end try | |
-- drop folder on icon | |
on open {droppedFolder} | |
try | |
tell application "Finder" | |
set the currentPath to (POSIX path of droppedFolder as text) | |
set the clipboard to currentPath | |
end tell | |
on error | |
my finderErrorMsg | |
end try | |
end open | |
-- error message | |
on finderErrorMsg() | |
display dialog "Unable to copy path." | |
buttons("Ok") | |
end finderErrorMsg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment