[TxMt] Save document and refresh current Safari window

Robert C. Mannl mannl at gmx.com
Thu Jan 5 14:58:59 UTC 2006


Hi!

I develop my Rails pages with two monitors.

On the left Monitor, I have TextMate open, on the right monitor, I  
have Safari with the current controller/action I'm editing open.

Instead of always manually:
  1) Saving document in TextMate
  2) Focusing Safari
  3) Refreshing Safari
  4) Put focus back on TextMate

I wrote the following Script in the Bundle Editor:


osascript -e "
	tell application \"System Events\"
		key down command
		keystroke \"s\"
		key up command
	end tell

	tell application \"Safari\"
		activate
	end tell
	
	tell application \"System Events\"
		key down command
		keystroke \"r\"
		key up command
	end tell

	tell application \"TextMate\"
		activate
	end tell
"


However, the last three lines make TextMate freeze, and Safari  
doesn't even Refresh. As soon as I remove those three lines,  
everything works (except of course, refocusing TextMate).


Any ideas?

Is there any support for TextMate? I bought TextMate a couple of  
months ago.




Thanks a bunch!


R. Christian



More information about the textmate mailing list