What's the best way to quickly develop and test gateway scoped scripts? The script console is nice but is only client scope, so if I need to test something like system.file.fileExists() I'm not quite sure the best way to actually test it and see the output like I would in the script console?
The most straight forward way that worked for me before is to just wire them in a Perspective screen and use a logger or system.perspective.print to debug.
Alternatively, I think Phil's toolkit module has a decorator @system.util.runInGateway that you can wrap your script.
This. Put your code to be tested in a project library function, with the decorator, and save. You can call from the script console and it will run in the gateway.
Also I threw a module up some time back that redirects the gateway logs to the designer so you can log debug scripts faster if you want it.
I typically configure a message handler on a project's gateway event, then call from the script console via system.util.send* functions.
I’ve found system.perspective.print() to be the most convenient option for quick testing and debugging from a Perspective view.
Thanks for sharing the Perspective options, but we're typically using Vision.
Anyway, I did find a decent workaround. Instead of using the script console to test my scripts I wrote a tag change script connected to a memory boolean. Had the gateway log open in a browser and toggled the tag to test it out.