public
Last active

Applescript for PowerMate that resizes a window for responsive web design testing

  • Download Gist
gistfile1.scpt
AppleScript
1 2 3 4 5 6 7 8 9 10 11 12
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.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.