Skip to content

Instantly share code, notes, and snippets.

@FranciscoG
Created May 5, 2014 14:49
Show Gist options
  • Save FranciscoG/4a94fca5fb452f2a7dda to your computer and use it in GitHub Desktop.
Save FranciscoG/4a94fca5fb452f2a7dda to your computer and use it in GitHub Desktop.
Applescript snippet to maximize current window. Use with Alfred for shortcut keys
-- source http://apple.stackexchange.com/questions/98187/applescript-the-activate-command-makes-application-half-active
-- tested on Mavericks, needs a Security & Privacy -> Accessibility feature turned on.
tell application "System Events" to tell (process 1 where frontmost is true)
click (button 1 where subrole is "AXZoomButton") of window 1
end tell
activate application (path to frontmost application as text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment