Advertisement
vandench

MaximizeWindow.script

Apr 13th, 2017
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. try
  2.     tell application "Finder" to set b to bounds of window of desktop
  3.     try
  4.         tell application (path to frontmost application as text)
  5.             set bounds of window 1 to {item 1 of b, 22, item 3 of b, item 4 of b}
  6.         end tell
  7.     on error
  8.         tell application "System Events" to tell window 1 of (process 1 where it is frontmost)
  9.             try
  10.                 set position to {0, 22}
  11.                 set size to {item 3 of b, (item 4 of b) - 22}
  12.             on error
  13.                 click (button 1 of window 1 where subrole is "AXZoomButton")
  14.             end try
  15.         end tell
  16.     end try
  17. end try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement