pattulus
4/13/2011 - 9:32 PM

applescript which copies current Finder path to clipboard.

applescript which copies current Finder path to clipboard.

-- 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