# Accessing window component in Project/Gateway scripts, without opening a window

**URL:** <https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056>\
**Category:** Ignition\
**Created:** [May 16, 2018, 8:36am UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056 "2018-05-16T08:36:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![sachin.rewale](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@sachin.rewale](https://forum.inductiveautomation.com/u/sachin.rewale)\
**Post date:** [May 16, 2018, 8:36am UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/1 "2018-05-16T08:36:30Z")

</div>

I want to access a window component in project script. But it is giving me a following error.  
“AttributeError: ‘com.inductiveautomation.ignition.common.script.Imm’ object has no attribute ‘gui’”.  
I tried to use “import system” in project script, but still getting the same error.

Does anyone have any idea, why system.gui is not getting imported.

And how can i access window component in project scripts without opening window.

Appreciated your help

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 16, 2018, 9:59am UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/2 "2018-05-16T09:59:35Z")

</div>

That particular error occurs when the script is running in the gateway. The gateway has no GUI, so the system.gui.\* functions cannot possibly work, and are therefore omitted. Any script that needs to access a client’s windows and components needs to run as a client event script, not a gateway event script.

---

<div class="post-metadata">

**Author:** ![sachin.rewale](https://avatars.discourse-cdn.com/v4/letter/s/d26b3c/32.png) [@sachin.rewale](https://forum.inductiveautomation.com/u/sachin.rewale)\
**Post date:** [May 16, 2018, 10:58am UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/3 "2018-05-16T10:58:20Z")

</div>

Can a component still be accessible event though a window is not running if try to access from client event script.

---

<div class="post-metadata">

**Author:** ![mrogers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mrogers/32/4110_2.png) [@mrogers](https://forum.inductiveautomation.com/u/mrogers)\
**Post date:** [May 16, 2018, 3:20pm UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/4 "2018-05-16T15:20:17Z")

</div>

Yes but its not supported (and liable to break with Ignition updates), and is a pain to do. If you can rework things to use something else for that, that would probably be easier.

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [May 16, 2018, 4:15pm UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/5 "2018-05-16T16:15:45Z")

</div>

What are you trying to do exactly?

---

<div class="post-metadata">

**Author:** ![sharan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sharan](https://forum.inductiveautomation.com/u/sharan)\
**Post date:** [January 24, 2023, 11:10am UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/6 "2023-01-24T11:10:31Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/f/afd26f9a30a28fe50f98d6c0c40902664b65b846.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/c/8cad5defe0e2d8521fde822c9d3803c848bc0f35.png)  
I am trying to access property of a component in Client tag change event scripts.i am getting error - what is wrong here ?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 24, 2023, 1:30pm UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/7 "2023-01-24T13:30:37Z")

</div>

You are close. The value for that component is not `.value`. There are four different ones, like `.intValue` or `.floatValue`. Use the property name that corresponds to the mode you selected for the component.

{ Hover over the property's "pretty" name to get a tooltip with the scripting name. Or look in the manual. }

---

<div class="post-metadata">

**Author:** ![sharan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sharan](https://forum.inductiveautomation.com/u/sharan)\
**Post date:** [January 24, 2023, 2:45pm UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/8 "2023-01-24T14:45:16Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/f/9f7033458bac5b005a5139691bcc182f55680d45.png)  
Still have the error, time to look into manuals

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 24, 2023, 3:08pm UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/9 "2023-01-24T15:08:57Z")

</div>

Look for a mistake in your names. Like extra spaces.

---

<div class="post-metadata">

**Author:** ![sharan](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@sharan](https://forum.inductiveautomation.com/u/sharan)\
**Post date:** [January 24, 2023, 4:06pm UTC](https://forum.inductiveautomation.com/t/accessing-window-component-in-project-gateway-scripts-without-opening-a-window/18056/10 "2023-01-24T16:06:30Z")

</div>

windows = system.gui.getOpenedWindowNames()  
#print windows # get list of all open windows  
if "Main Windows/MANUAL" in windows: # check if hookupunhookup is open  
main = system.gui.getWindow("Main Windows/MANUAL")  
button = main.getRootContainer().getComponent("Availability").getComponent("BREAK\_TIIME").intValue

This code worked. Thanks@pturmel  
There was a extra I in BREAK\_TIIME component but that was not the issue, even with proper name I was getting error, but this above code did the job
