on run # # {{w, h}, {x, y}} # set a to "{{500, 800}, {0, 22}}" set b to "{{500, 400}, {500, 22}}" set c to "{{500, 400}, {500, 422}}" set d to "{{500, 400}, {1000, 22}}" set x to "{{false, false}, {false, false}}" set ary to {a, b, c, d, x} tell application "System Events" set pids to id of processes whose frontmost is true and name is "Google Chrome" if length of pids is 0 then return end if set pid to item 1 of pids tell process id pid tell item 1 of (windows whose subrole is "AXStandardWindow") set {{w, h}, {x, y}} to my set_size_and_position(ary) if w is false then return end if set size to {w, h} set position to {x, y} end tell end tell end tell end run on set_size_and_position(ary) tell application "System Events" activate set res to choose from list ary if res is false then error number -128 end if return run script (item 1 of res) end tell end set_size_and_position