endlesslove_1998

Start chrome with custom position and size 2

Sep 27th, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.95 KB | None | 0 0
  1. $chromePath = "C:\Program Files\Google\Chrome\Application\chrome.exe"
  2.  
  3. $x = 0
  4. $y = 0
  5. $width = 500
  6. $height = 500
  7. $url = "https://autoitscript.com/"
  8.  
  9. ;~ Run(StringFormat('"%s" --new-window --window-position=%d,%d --window-size="%d,%d" "%s"', $chromePath, $x, $y, $width, $height, $url))
  10. Run(StringFormat('"%s" --new-window --app="data:text/html,<html><body><script>window.moveTo(%d,%d);window.resizeTo(%d,%d);window.location=''%s'';</script></body></html>"', $chromePath, $x, $y, $width, $height, $url))
  11.  
  12. Sleep(1000)
  13.  
  14. $x = 500
  15. $y = 0
  16. $width = 700
  17. $height = 500
  18. $url = "https://google.com/"
  19.  
  20. ;~ Run(StringFormat('"%s" --new-window --window-position=%d,%d --window-size="%d,%d" "%s"', $chromePath, $x, $y, $width, $height, $url))
  21.  
  22. Run(StringFormat('"%s" --new-window --app="data:text/html,<html><body><script>window.moveTo(%d,%d);window.resizeTo(%d,%d);window.location=''%s'';</script></body></html>"', $chromePath, $x, $y, $width, $height, $url))
Advertisement
Add Comment
Please, Sign In to add comment