Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (30 sloc) 806 Bytes
#!/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