Storing handler call in variable

Odd request and maybe a better way to do it but in short here is my scenario

  • calling a handler to do some navigation
  • additional handler is verifying on a new screen and if not on a new screen then call the above handler again (in some retry logic)

Trying to store the original handler call and its parameters in a variable that I can then call in the verify new screen handler as a param or global variable of some kind.

Doubting this is possible as I can pretty easily store the call in variable but when called it gives an error about the expecting object or script identifier. Doubting this is possible but thought I might ask if a way to get what the last successful handler call was

Attached screenshot of a dumbed-down example

Ok did figure this out if anyone finds this post

set lastHandler to “ClickandVerify.logSomething”
set lastParams to “xyz”
send lastHandler & " lastParams as parameters" to senseTalk

This might also work.

set script to me
set lastcmd to "logSomething"
log lastcmd

to logSomething something
    if something is empty then set something to "abc"
    log something
end logSomething