# Problem calling system.gui from app script

**URL:** <https://forum.inductiveautomation.com/t/problem-calling-system-gui-from-app-script/7415>\
**Category:** Ignition\
**Created:** [October 15, 2013, 12:25pm UTC](https://forum.inductiveautomation.com/t/problem-calling-system-gui-from-app-script/7415 "2013-10-15T12:25:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brett\_Yeomans](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brett\_Yeomans](https://forum.inductiveautomation.com/u/Brett_Yeomans)\
**Post date:** [October 15, 2013, 12:25pm UTC](https://forum.inductiveautomation.com/t/problem-calling-system-gui-from-app-script/7415/1 "2013-10-15T12:25:58Z")

</div>

I have a gateway script which calls an app script.

The app script works fine UNTIL I try to put this code in it:

system.gui.messageBox(“Test”)

In the wrapper log it says

` File "<TagChangeScript:swipeCard_Test/AP1Read>", line 18, in <module>
INFO | jvm 1 | 2013/10/15 13:18:58 | File "<module:app.swipeCard>", line 6, in newRead
INFO | jvm 1 | 2013/10/15 13:18:58 | AttributeError: 'com.inductiveautomation.ignition.common.script.Scr' object has no attribute 'gui'`

Even though I have the “Import System” at the top of the script plus many other system requests in the same app script  
i.e system.cb.runPrepUpdate etc

The original aim (4 hours ago) was to have the app script refresh a table on the open window which finally led me to where I am now ☹

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [October 15, 2013, 2:58pm UTC](https://forum.inductiveautomation.com/t/problem-calling-system-gui-from-app-script/7415/2 "2013-10-15T14:58:11Z")

</div>

Hi Brett,

Gateway scripts run on the Ignition Gateway server — they do not run in clients, so there are no GUI functions.

You should put your code in Client Scripts or event scripts.

---

<div class="post-metadata">

**Author:** ![Brett\_Yeomans](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@Brett\_Yeomans](https://forum.inductiveautomation.com/u/Brett_Yeomans)\
**Post date:** [October 15, 2013, 6:34pm UTC](https://forum.inductiveautomation.com/t/problem-calling-system-gui-from-app-script/7415/3 "2013-10-15T18:34:09Z")

</div>

Thanks nmudge.

Since the same code in the same app ‘folder’ location works when called by a button is it right to say that an app script runs in the same location that the script is that called it?

I get Gateway and Client scripts but am unsure how the app scripts function.  
I would like to fully understand this because the Ignition manual uses a gui example for how to write an app and says you have to import system - which to a Noob like me says if you import system you have full access to all scripting functions.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [October 15, 2013, 6:38pm UTC](https://forum.inductiveautomation.com/t/problem-calling-system-gui-from-app-script/7415/4 "2013-10-15T18:38:41Z")

</div>

Yes, the app functions run where they are called. app functions called in client scripts and event handlers will run in a client. app functions called in a Gateway Script run in the gateway.

---

<div class="post-metadata">

**Author:** ![Dalyn](https://avatars.discourse-cdn.com/v4/letter/d/e36b37/32.png) [@Dalyn](https://forum.inductiveautomation.com/u/Dalyn)\
**Post date:** [October 24, 2021, 3:51pm UTC](https://forum.inductiveautomation.com/t/problem-calling-system-gui-from-app-script/7415/5 "2021-10-24T15:51:25Z")

</div>

Hello, I’m having the same issue calling any scripts with “system.gui.” from any of my event scripts.  
I’m currently running on Ignition Gateway Platform 8.1.10 with Perspective Module 2.1.10.

It will not work on any of my Perspective Components Inputs or icons when configured in “Configure Events…” of any “Organize Actions”. I’ve followed all the examples given in the Ignition manual and videos on Inductive University and they all came with the same error:

Even with a simple script such as “system.gui.messageBox(“Hello World!”)” I’ll get this error message:

"Error running action ‘dom.onClick’ on Work House@D/root/Icon\_0: AttributeError:  
‘com.inductiveautomation.ignition.coom.script.Imm’ object has no attribute ‘gui’ "

Thank you for your help

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [October 24, 2021, 4:26pm UTC](https://forum.inductiveautomation.com/t/problem-calling-system-gui-from-app-script/7415/6 "2021-10-24T16:26:29Z")

</div>

Same problem, same answer - you can’t run system.gui scripts from anything that is in the gateway scope, which includes Perspective. They are for use in the Vision client.

If you’re trying to open a popup from Perspective then check out [system.perspective.openPopup](https://docs.inductiveautomation.com/display/DOC81/system.perspective.openPopup). It sounds like you may be reading the wrong section of the user manual and following the wrong videos if you’re using Perspective.
