Created
May 9, 2012 20:25
-
-
Save brianboyer/2648545 to your computer and use it in GitHub Desktop.
Applescript for PowerMate that resizes a window for responsive web design testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.