Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Put a file's path on the clipboard via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Put a file's path on the clipboard via AppleScript
Authored by: jmck on Apr 19, '07 07:43:07AM
I wrote this droplet to make sure what I get is a Unix-style path that can be used with Services>Finder>Reveal, et cetera

on open theFile
	set thePath to POSIX path of theFile
	set the clipboard to thePath as text
end open
For non-Cocoa email apps, Acrobat, etc, this companion script will take the place of Services>Finder>Reveal : take a POSIX path off of the clipboard and reveal it in the Finder.

	set posixPath to the clipboard
	set pf to POSIX file posixPath
	set a to pf as alias
	tell application "Finder"
		reveal a
	end tell


[ Reply to This | # ]