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


Click here to return to the '10.4: Use Automator to open chosen folder in Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Automator to open chosen folder in Terminal
Authored by: juanfal on Aug 31, '05 02:54:03PM
Thanks Rob and Arlo
Finally the most simple (and secure) way should be this only Script in Automator!:
on run {input, parameters}
	
	tell application "Terminal"
		activate
		if (the (count of the window) = 0) or (the busy of window 1  = true) then
			tell application "System Events"
				keystroke "n" using command down
			end tell
		end if
		
		do script "cd " & (quoted form of POSIX path of  (input as string))  in window 1
	end tell
	return input
end run

I have tested it with "accented" paths and paths withs spaces and it works perfectly.
thanks for your comments!

[ Reply to This | # ]