Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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

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