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


Click here to return to the '... Or use an Applescript droplet' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
... Or use an Applescript droplet
Authored by: cnotarianni on Feb 15, '05 09:41:25AM
You ca use an Applescript like this: drag one or more files on top of it and volià!

(* 
Copyright © Notarianni Carlo
*)

choose file with prompt "Choose the file to get path"
open (result as list)


on open (thelist)
	(*
	open receives a list of documents that were dragged onto the droplet's icon, and passes 
	the document names one at a time to the handle routine. 
	*)
	set TempClipboard to ""
	repeat with theNames in thelist
		tell application "Finder"
			set TempPath to theNames as text
			--copy TempPath & "" to TempPath
		end tell
		if TempClipboard is "" then
			set TempClipboard to TempPath
		else
			set TempClipboard to TempClipboard & (ASCII character 13) & TempPath
		end if
	end repeat
	set the clipboard to TempClipboard
end open


[ Reply to This | # ]
... Or use an Applescript
Authored by: macintron on Feb 16, '05 02:25:29AM
... and save it in your '~/Library/Scripts/' folder

tell application "Finder"
	try
		set frontPath to get selection as alias
		set posixPath to (get POSIX path of frontPath)
		set hfsPath to (frontPath as string)
		
		set theMsg to "Copy path to clipboard: " & return & "POSIX:" & return & posixPath & return & return & "HFS:" & return & hfsPath
		tell me to display dialog theMsg buttons {"POSIX", "HFS", "Cancel"} default button 1
		set userAnswer to button returned of result
		if userAnswer is "POSIX" then
			set the clipboard to the (posixPath as string)
		else if userAnswer is "HFS" then
			set the clipboard to the hfsPath
		end if
	end try
end tell


[ Reply to This | # ]