Skip to main content
added 724 characters in body
Source Link
Lri
  • 106.4k
  • 19
  • 230
  • 283

it clashes with other commands in some applications, for example this one I'm using right now, Firefox.

Firefox doesn't support System Preferences ▸ KBS at all...

@Asmus

the zoom button (that´s button 2)

In at least iTunes 10 button 2 has changedI have assigned this script to minimize. (1 = maximize, 3 = close.)

Doesn't rely on GUI scripting⌘M with FastScripts:

try
    tell appapplication "Finder" to bounds of window of desktop
    tell application (path to frontmost application as text)
    try
        set zoomedbounds of window 1 to notresult
 (zoomed of window 1)end tell
on error
   end try
end tell

Windows-style:

tell app "Finder" to set dtb to boundstell ofapplication window"System ofEvents" desktop
tellto apptell (pathprocess to1 frontmostwhere applicationit asis textfrontmost)
    try
        setclick bounds(button 1 of window 1 towhere dtbsubrole is "AXZoomButton")
        end tell
    end try
end telltry

It doesn't work if you have multiple displays though.

Applications that support maximizing windows to fill the screen:

it clashes with other commands in some applications, for example this one I'm using right now, Firefox.

Firefox doesn't support System Preferences ▸ KBS at all...

@Asmus

the zoom button (that´s button 2)

In at least iTunes 10 button 2 has changed to minimize. (1 = maximize, 3 = close.)

Doesn't rely on GUI scripting:

tell app (path to frontmost application as text)
    try
        set zoomed of window 1 to not (zoomed of window 1)
    end try
end tell

Windows-style:

tell app "Finder" to set dtb to bounds of window of desktop
tell app (path to frontmost application as text)
    try
        set bounds of window 1 to dtb
    end try
end tell

I have assigned this script to ⌘M with FastScripts:

try
    tell application "Finder" to bounds of window of desktop
    tell application (path to frontmost application as text)
        set bounds of window 1 to result
    end tell
on error
    try
        tell application "System Events" to tell (process 1 where it is frontmost)
            click (button 1 of window 1 where subrole is "AXZoomButton")
        end tell
    end try
end try

It doesn't work if you have multiple displays though.

Applications that support maximizing windows to fill the screen:

Source Link
Lri
  • 106.4k
  • 19
  • 230
  • 283

it clashes with other commands in some applications, for example this one I'm using right now, Firefox.

Firefox doesn't support System Preferences ▸ KBS at all...

@Asmus

the zoom button (that´s button 2)

In at least iTunes 10 button 2 has changed to minimize. (1 = maximize, 3 = close.)

Doesn't rely on GUI scripting:

tell app (path to frontmost application as text)
    try
        set zoomed of window 1 to not (zoomed of window 1)
    end try
end tell

Windows-style:

tell app "Finder" to set dtb to bounds of window of desktop
tell app (path to frontmost application as text)
    try
        set bounds of window 1 to dtb
    end try
end tell