Yes it's possible to have the macro end when address bar changes
There are several ways
this is using an Accessible Object trigger
insert this line of code in main macro
Function ChromeAddressBarChange
Trigger $a 142 -4 "" "Chrome_WidgetWin_1" "" "" "" "" 42 0x100000 "Address and search bar"
this is using a function that repeatedly checks for the change in the address bar
this should run in its own thread
insert this line in main macro
Function WaitForAddressBarChange
there are other ways depends on code in main macro.
There are several ways
this is using an Accessible Object trigger
insert this line of code in main macro
Function ChromeAddressBarChange
Trigger $a 142 -4 "" "Chrome_WidgetWin_1" "" "" "" "" 42 0x100000 "Address and search bar"
;\
function hwnd idObject idChild
Acc a.FromEvent(hwnd idObject idChild)
out a.Value
bee
shutdown -6 0 "Macro name goes here"
dis+ "ChromeAddressBarChange"
this is using a function that repeatedly checks for the change in the address bar
this should run in its own thread
insert this line in main macro
Function WaitForAddressBarChange
int w=win("- Google Chrome" "Chrome_WidgetWin_1")
Acc a.Find(w "TEXT" "Address and search bar" "class=Chrome_WidgetWin_1" 0x35)
str originalValue=a.Value
spe -2
rep
,a.Find(w "TEXT" "Address and search bar" "class=Chrome_WidgetWin_1" 0x35)
,str newValue=a.Value
,if newValue!=originalValue
,,break
,0.3
bee
shutdown -6 0 "Macro name goes here"
there are other ways depends on code in main macro.