Skip to content

Instantly share code, notes, and snippets.

@brianboyer
Created May 9, 2012 20:25
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianboyer/2648545 to your computer and use it in GitHub Desktop.
Save brianboyer/2648545 to your computer and use it in GitHub Desktop.
Applescript for PowerMate that resizes a window for responsive web design testing
tell application "System Events"
set frontmostProcess to name of first item of (processes whose frontmost is true)
tell process frontmostProcess
tell window 1
set oldSize to get size
-- change + to - for shrinking
-- change 100 to 5 for fine-tune mode
set newWidth to (item 1 of oldSize) + 100
set size to {newWidth, item 2 of oldSize}
end tell
end tell
end tell
@inlikealion
Copy link

Love the idea! Any chance there's a way to cancel the script from firing again while the resize is being done? Like poor JS sliders this allows for an 'animation queue' that can make the browser unusable until it catches up with the queue.

Thanks for sharing this gist with us Brian.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment