This script is working fine when I run it in the foreground with Send and MouseClick instead of ControlSend and ControlClick (and wb.Visible = true). What is the issue here with running it in the background?
code1 := "foobar"
url := "https://app.powerbi.com/groups/me/reports/xxx"
wb := ComObjCreate("InternetExplorer.Application") ;create com object
wb.Visible := false ;true to show IE
wb.Navigate(url)
while (wb.busy) ;wait while page loads
sleep 10
ControlSend,, {LWin down}{Up down}
ControlSend,, {LWin up}{Up up}
sleep 20000
ControlClick, left, 1275, 320
sleep 3000
ControlClick, left, 1275, 510
sleep 500
ControlClick, left, 2200, 1380
sleep 3000
ControlClick, left, 2200, 1380
sleep 3000
ControlClick, left, 2200, 1380
sleep 120000
ControlClick, left, 2760, 2000
sleep 500
ControlClick, left, 2760, 2000
sleep 5000
ControlClick, left, 2760, 2000
sleep 3000
ControlClick, left, 2760, 2000
getElementById(),getElementsByName(),getElementsByTagName()and then.focus(),.click()or.value=to do what you want.