Last active
December 23, 2015 07:29
-
-
Save GarthDB/6600779 to your computer and use it in GitHub Desktop.
A work in progress - I want to make a rake task that will open a page in a new chrome window, then resize it to a specific size and take a screenshot. Should be awesome if it works.
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 "/Applications/Google Chrome.app" | |
make new window | |
activate | |
end tell |
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
screencapture -c | |
http://www.maclife.com/article/columns/terminal_101_taking_screenshots_through_command_line |
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
to splitString(aString, delimiter) | |
set retVal to {} | |
set prevDelimiter to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to {delimiter} | |
set retVal to every text item of aString | |
set AppleScript's text item delimiters to prevDelimiter | |
return retVal | |
end splitString | |
on alfred_script(q) | |
set newDimensions to splitString(q as text, "x") | |
tell application "System Events" | |
set frontApp to name of first application process whose frontmost is true | |
end tell | |
tell application "System Events" to tell application process frontApp | |
tell window 1 | |
set size to {item 1 of newDimensions, item 2 of newDimensions} | |
end tell | |
end tell | |
end alfred_script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment