Split full-fledged JavaScript code into different executeScript commands

When writing a full-fledged JavaScript, how can I split all my classes into different UI.Vision executeScript commands so it’s somehow readable? The current JS code I’ve written is almost a thousand of lines and is working when put in ONE executeScript command but I want to split them so that it’s
“easier” to maintain.


  "Command": "executeScript_Sandbox",
  "Target": "return class ClassWithStaticMethod {   static staticMethod() {     return 'static method has been called.';   } } ",
  "Value": "ClassWithStaticMethod"
  "Command": "executeScript_Sandbox",
  "Target": "var s = \"Hello World! \" + ClassWithStaticMethod.staticMethod(); return s",
  "Value": "testReturn"

What I’m trying to say is, how would I call the JavaScript static methods / functions coming from the previous line?

[error] Error in executeScript code: Cannot read property ‘staticMethod’ of undefined

Is the only way this would work is if the whole JavaScript code is in one executeScript[_Sandbox] command?

Wow. What does this code do?

Haha you know I don’t mean that and I think you need to answer my question first. :joy:

:blush: Is what I’m doing possible?