'Sizing and moving chrome windows does not work

I would like to create a shortcut that opens two chrome windows below each other. Created the following code:

!a::
 Run, https://calendar.google.com/calendar/u/0/r
 Sleep, 3000
 winactivate, ahk_class  Chrome_WidgetWin_1
 Sleep, 500

 Run, chrome.exe "https://outlook.office365.com/calendar/view/workweek" " --new-window "
 Sleep, 3000
 WinMove, ahk_class Chrome_WidgetWin_1, , 1000, 0 , 800, 600
 Sleep, 500
 return

It opens two windows but for some reason the moving and sizing part does not work (they are just placed on top of each other and the size of the windows does not change, they stay full screen) Any thoughts on what is going wrong here? The same code does work for opening folders (and then it moves correctly).

kr, Marc



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source