System.gui attribute error

Error running action 'dom.onClick' on IP_Add@D/root/Button_0: Traceback (most recent call last): File "function:runAction", line 2, in runAction File "module:IP_addition", line 5, in confirmationBox AttributeError: 'com.inductiveautomation.ignition.common.script.Imm' object has no attribute 'gui'

Code is:
def confirmationBox():
system.gui.confirm("Are you sure you want to shutdown the plant?",
"Really Shutdown?")

This runs on my script console but not when I call it from a event script?
Any suggestions?

system.gui.* and system.nav.* are entirely Vision only. The designer environment is a variation of Vision Client scope, so it works there.

Tip: Use the </> button to format code. This will preserve indents and apply syntax highlighting like this:

def confirmationBox():
    system.gui.confirm("Are you sure you want to shutdown the plant?",
                       "Really Shutdown?")

Got it. Thank you.
When I launch my perspective window, it says "View not found": NO view configured for this page.
Any suggestions for this?

Go to the root node of the Perspective workspace (in the designer tree). It shows your page configurations there. One or more must be present, and each must have a starting view assigned.

Is there any system.gui equivalent for perspective?

Bits and pieces. Some stuff is available as session properties. Some stuff is available from various system.perspective.* functions, particularly the .projectInfo and .sessionInfo functions.

Vision and Perspective are so fundamentally different that there are many things that have no 1:1 equivalent.

1 Like

Got it. Thank you so much :slight_smile: