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


Click here to return to the '10.4: A simple way to copy the path to a file or folder' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: A simple way to copy the path to a file or folder
Authored by: regulus on Oct 21, '07 08:45:30AM
Here's my applescript. It automatically paste's the path wherever your cursor is when you run the script. Note: I don't use the posix path so you'll have to add that yourself if you want the posix path.
tell application "Finder" to set selected_item to (item 1 of (get selection)) as Unicode text
set the clipboard to selected_item
tell application (getFrontApp()) to activate
tell application "System Events" to keystroke "v" using command down


on getFrontApp()
	set frontApp to displayed name of (info for (path to frontmost application))
	set script_name to displayed name of (info for (path to me))
	if frontApp is script_name then
		tell application "System Events" to set visible of process script_name to false
		set frontApp to displayed name of (info for (path to frontmost application))
	end if
	return frontApp
end getFrontApp


[ Reply to This | # ]