Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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):

Code Block
#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:

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


Project file:

View file
nameOpen Console Clean and Print.proj
height250