Script Console Instances

Hi everyone,

I would like to know if there's a way to open multiple instances of the 'Script Console' within a single Designer.

Thanks.

Not really, though with sufficient hacking I'm sure it's possible. No idea how well they would work together though.

Why?

I would like to be able to test some code without having to comment (or copy/save) the existing code. A single 'script console' would also be fine but with the ability to open multiple 'editors' and execute script as "new task".

Have you considered simply opening multiple designers?

1 Like

I think I see what you're wanting....neat idea. Almost something like some of the SQL management tools out there where you can have multiple tabs for running various scripts, and it runs the entire script by default, but you can also select a portion of the script and only execute the selected portion. Would definitely be handy!

1 Like

Hi, yes! in my original question I asked for ".. within a single Designer." for that reason.

from com.inductiveautomation.ignition.designer import IgnitionDesigner
from com.inductiveautomation.ignition.designer.gui import CommonUI
from com.inductiveautomation.ignition.designer.gui.tools import InteractiveScriptPlayground

designer = IgnitionDesigner.getFrame()
context = designer.context
console = InteractiveScriptPlayground(context)
console.size = (1024, 600)
CommonUI.centerComponent(console, designer)
console.visible = True
console.title = "Console 2"

I can immediately tell you one significant flaw - additional consoles you open this way will not get project or Python library updates delivered to them. I didn't notice any other significant issues with this approach in the seconds of testing I did.

Do not contact Support if this stops working or does something weird.

10 Likes

Thank you for your response!