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


Click here to return to the 'Create identical tiled windows in most apps via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create identical tiled windows in most apps via AppleScript
Authored by: bootle on Jun 20, '07 10:42:00AM
I've been trying to do something very similar for a very long time. Use a quicksilver trigger to just center the frontmost window. I could never get it to work (I hate applescript), until I saw this script.

tell application "Finder"
	set screenSize to bounds of window of desktop
	set screenWidth to item 3 of screenSize
end tell

tell application "System Events"
	set myFrontMost to name of first item of (processes whose frontmost is true)
end tell

try
	tell application myFrontMost
		set windowSize to bounds of window 1
		set windowXl to item 1 of windowSize
		set windowYt to item 2 of windowSize
		set windowXr to item 3 of windowSize
		set windowYb to item 4 of windowSize
		
		set windowWidth to windowXr - windowXl
		
		set bounds of window 1 to {(screenWidth - windowWidth) / 2.0,
 windowYt, (screenWidth + windowWidth) / 2.0, windowYb}
	end tell
end try
Works exactly how I always wanted, I set it to ctrl+option+shift+c

[ Reply to This | # ]