You can iterate over all the ShellWindow instances in a code stage to find a reference to the IHTMLWindow2 interface of your automated application or, as part of your javascript execution create a hidden element on the page and store the variable in the element's value, then use Blue Prism to read that element's value