Skip to end of metadata
Go to start of metadata

Overview

How to open the Designer Console via scripting, in preparation for printing (with optional script for clearing the existing contents). The script eliminates the need to open the Designer Console manually, each time, using Tools → Console (or Ctrl-Shift-C).

Details

To open the Designer Console, use this code (courtesy of Connor Elison @ Sepasoft):

#open the Designer Console
from java.awt import Robot
from java.awt.event import KeyEvent
robot = Robot()
robot.keyPress(KeyEvent.VK_CONTROL)
robot.keyPress(KeyEvent.VK_SHIFT)
robot.keyPress(KeyEvent.VK_C)
robot.keyRelease(KeyEvent.VK_CONTROL)
robot.keyRelease(KeyEvent.VK_SHIFT)
robot.keyRelease(KeyEvent.VK_C)


To clear the contents of the Designer Console, use this code:

#clear the Designer Console (optional)
from com.inductiveautomation.ignition.client.util.gui import OutputConsole
OutputConsole.getInstance().getComponent(0).getComponent(1).doClick()


Project file:

Open Console Clean and Print.proj