How can I check if a form field exists?

Hey guys, wondering if anyone's thought of an updated solution. In this example, the javascript code waits until a class element exists, and if it does, it will spit out "done" in the console. This works just fine on the browser end. However in KM, I can't get the sequence to keep moving.. it kind of just stops right there.

I somehow can't figure out how to return a variable from the script and keep the flow moving.. does anyone have any thoughts on this?

image

JavascriptToWaitForBrowser.kmactions (2.5 KB)