Skip to content

Instantly share code, notes, and snippets.

@hankpillow
Created November 16, 2010 18:42
Show Gist options
  • Save hankpillow/702250 to your computer and use it in GitHub Desktop.
Save hankpillow/702250 to your computer and use it in GitHub Desktop.
copies to the clipboard the full path of selected files.
on run
tell application "Finder"
set file_list to the selection as list
if length of file_list > 0 then
set full_list to ""
repeat with x in file_list
if length of full_list = 0 then
set full_list to (POSIX path of file (x as text))
else
set full_list to full_list & return & (POSIX path of file (x as text))
end if
end repeat
set the clipboard to full_list
else
display dialog "nothing selected" buttons {"ok"}
end if
end tell
end run
@hankpillow
Copy link
Author

I think this isn't the best way of creating droplets, but it has just worked for me (mac os 10.5)

1 - save this code at ~/Library/Scripts/Droplet/getpath.scpt (create the folder structure if you haven't)
2 - open the getpath.scpt with "Script Editor" and save as "Application" and set the "Run Only" option
3 - drag the getpath.path to the finder "header"
4 - just command+v to and you'll see the full path of the selected file.

@rafaelrinaldi
Copy link

Pretty useful.

@hankpillow
Copy link
Author

now working with a list of files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment