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


Click here to return to the 'Spatial Terminal Switching' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Spatial Terminal Switching
Authored by: escowles on Feb 13, '07 10:50:21AM
And, if you open terminals in order and place them in order, you can cycle through them with Cmd-Right going clockwise and Cmd-Left going counter-clockwise. I wrote a small applescript to setup 4 terms in order:

tell application "Terminal"
	repeat while the (count of windows) is less than 4
		do script ""
	end repeat
	set windowList to the windows
end tell

updateWindow(the first item in windowList, 2, 23, 80, 30)
updateWindow(the second item in windowList, 2, 474, 80, 30)
updateWindow(the third item in windowList, 508, 474, 80, 30)
updateWindow(the fourth item in windowList, 508, 23, 80, 30)

on updateWindow(theWindow, x, y, cols, rows)
	tell application "Terminal"
		set the position of theWindow to {x, y}
		set the number of rows of theWindow to rows
		set the number of columns of theWindow to cols
	end tell
end updateWindow

Of course, the coordinates and sizes will vary depending on your screen size and tastes. I've got slightly different scripts for 2, 4 and 6-term setups, depending on what I'm working on. I also like a couple of pixels around and between my terms, but this could be adjusted to have them exactly at the edges and touching each other.

-Esme



[ Reply to This | # ]