OSX Zoom
One of the things I still find annoying about OSX is the green window zoom button. I want it to operate like the min/maximise button in Windows, and this script achieves that for me, in Terminal at least.
[EDIT: 2008-12-05]
And “Need a better way to resize windows, dragging the lower right corner doesn’t cut it.”
And “Finder window to max shortcut?”
And “Add new or change green button?”
And Window Size/Position on Different Monitors
And “Create a keyboard shortcut for the maximize button”
There are also some interesting comments on “Make utility Terminal windows less intrusive” regarding com.apple.Terminal.plist
WinLocX 0
WinLocY 0
WinLocULY 746
Download UI Element Inspector
DISCOVERING AN OBJECT’S HIERARCHY
tell application "System Events" to click (first button whose subrole is "AXZoomButton") of (first window whose subrole is "AXStandardWindow") of (first process whose frontmost is true)
tell application “Safari”
set props to properties of front window
end tell
tell application “System Events”
set theProcesses to every process whose visible is true
repeat with theProcess in theProcesses
tell theProcess
set theWindows to every window
repeat with theWindow in theWindows
set theButtons to (buttons of theWindow)
repeat with theButton in theButtons
try
if (subrole of theButton) is "AXZoomButton" then click theButton
end try
end repeat
end repeat
end tell
end repeat
end tell
tell application "System Events" set app_name to name of the first process whose frontmost is true end tell
tell application "System Events" to tell process app_name
tell front window
set position to {0, 0}
set size to {1280, 1024}
end tell
try
click menu item "Zoom To Fit" of menu 1 of menu bar item "View" of menu bar 1
end try
end tell
tell application "Finder"
set {d1, d2, d3, d4} to (desktop's window's bounds)
set margins to {d1 + 10, d2 + 54, d3 - 10, d4 - 148}
set bounds of every window to margins
--replace the previous line with the following for just the front window:
--set bounds of window 1 to margins
end tell
tell application “Safari” activate –get bounds of front window set bounds of front window to {0, 22, 1024, 768} end tell
try
tell application “System Events” to set applname to (name of (some process whose frontmost is true)) as text
– display dialog applname — diagnostic only
if applname = “Finder” then return
tell application applname to set bounds of window 1 to {0, 22, 1200, 1000} — for 1680 x 1050 monitor
on error
tell application “Finder” to beep
end try
tell application "System Events" to set applname to (title of (some process whose frontmost is true)) as text
tell application “Safari”
tell document 1 to do JavaScript “javascript:self .moveTo(0,0);self.resizeTo(screen.availWidth,screen.availHeight);”
end tell
http://lists.apple.com/archives/AppleScript-Users/2008/May/msg00087.html
No comments yet.