Skip to content

Instantly share code, notes, and snippets.

@geetarista
Last active August 29, 2015 14:05
Show Gist options
  • Save geetarista/e9289b5f0c92819b6106 to your computer and use it in GitHub Desktop.
Save geetarista/e9289b5f0c92819b6106 to your computer and use it in GitHub Desktop.
tell application "Finder"
set b to bounds of window of desktop
set width to item 3 of b
set height to item 4 of b
end tell
set name to name of (info for (path to frontmost application))
set q to "{query}"
tell application name
activate
if q is "f" then
set bounds of first window to {0, 0, width, height}
else if q is "m" then
set bounds of first window to {(width / 8), (height / 8), (width / 1.125), (height / 1.125)}
else if q is "tr" then
set bounds of first window to {(width / 2), 0, width, (height / 2)}
else if q is "tl" then
set bounds of first window to {0, 0, (width / 2), (height / 2)}
else if q is "th" then
set bounds of first window to {0, 0, width, (height / 2)}
else if q is "r" then
set bounds of first window to {(width / 2), 0, width, height}
else if q is "l" then
set bounds of first window to {0, 0, (width / 2), height}
else if q is "br" then
set bounds of first window to {(width / 2), (height / 2), width, height}
else if q is "bl" then
set bounds of first window to {0, (height / 2), (width / 2), height}
else if q is "bh" then
set bounds of first window to {0, (height / 2), width, height}
else if q is "h" then
set bounds of first window to {(width / 4), 0, (width / 1.25), height}
end if
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment