Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 35 lines (30 sloc) 0.806 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
#!/usr/bin/ruby

# Dropzone Destination Info
# Name: Finder Path
# Description: Copies the path of the currently selected item in the Finder to the clipboard.
# Handles: NSFilenamesPboardType
# Events: Clicked
# Creator: Aptonic Software
# URL: http://aptonic.com
# IconURL: http://aptonic.com/destinations/icons/finder.png

def clicked

path=`osascript <<END
  tell application "Finder"
   set theSelection to the selection
   try
   set theSelection to theSelection as string
   set finder_path to POSIX path of theSelection
   on error
   set finder_path to null
   end try
  end tell
  if finder_path is not null then return finder_path
END`

  if (path == nil or path == "")
    $dz.finish("Nothing selected")
    $dz.url(false)
  else
    $dz.finish("Path copied")
    $dz.text(path)
  end
  
end
Something went wrong with that request. Please try again.