Skip to content

Instantly share code, notes, and snippets.

@hui
Created February 7, 2010 09:29
Show Gist options
  • Save hui/297343 to your computer and use it in GitHub Desktop.
Save hui/297343 to your computer and use it in GitHub Desktop.
using terms from application "Google Chrome"
tell application "Google Chrome"
activate
display dialog "Please select a size." buttons {"640 x 480", "800 x 600", "1024 x 768"} with icon note
set button_pressed to the button returned of the result
if button_pressed is "640 x 480" then
set x_size to 640
set y_size to 480
else if button_pressed is "800 x 600" then
set x_size to 800
set y_size to 600
else if button_pressed is "1024 x 768" then
set x_size to 1024
set y_size to 768
end if
tell front window
set OrigBounds to bounds
set bounds to {(item 1 of OrigBounds), (item 2 of OrigBounds), (item 1 of OrigBounds) + x_size, (item 2 of OrigBounds) + y_size}
end tell
end tell
end using terms from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment