# Find a component property in a different window and that is inside a group

**URL:** <https://forum.inductiveautomation.com/t/find-a-component-property-in-a-different-window-and-that-is-inside-a-group/85202>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [February 4, 2024, 3:07pm UTC](https://forum.inductiveautomation.com/t/find-a-component-property-in-a-different-window-and-that-is-inside-a-group/85202 "2024-02-04T15:07:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![david\_rafael\_ulloque](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@david\_rafael\_ulloque](https://forum.inductiveautomation.com/u/david_rafael_ulloque)\
**Post date:** [February 4, 2024, 3:07pm UTC](https://forum.inductiveautomation.com/t/find-a-component-property-in-a-different-window-and-that-is-inside-a-group/85202/1 "2024-02-04T15:07:59Z")

</div>

Hello everyone, i wolud like to know if there is a way to find a component property in a different windows and the component is also in a group.

---

<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:** [February 4, 2024, 3:39pm UTC](https://forum.inductiveautomation.com/t/find-a-component-property-in-a-different-window-and-that-is-inside-a-group/85202/2 "2024-02-04T15:39:45Z")

</div>

Yes, but only in a script, not in a binding. First, you would use [system.gui.getWindow](https://docs.inductiveautomation.com/display/DOC81/system.gui.getWindow) to obtain the window object (it must be open), then use its [.getComponentForPath()](https://docs.inductiveautomation.com/display/DOC81/Vision+-+The+Window+Object+Scripting+Functions#VisionTheWindowObjectScriptingFunctions-.getComponentForPath) method to drill into the component hierarchy to the target component. You can then access its properties as jython attributes. (Using their scripting names--shown when hovering in the property panel.)

---

<div class="post-metadata">

**Author:** ![david\_rafael\_ulloque](https://avatars.discourse-cdn.com/v4/letter/d/e68b1a/32.png) [@david\_rafael\_ulloque](https://forum.inductiveautomation.com/u/david_rafael_ulloque)\
**Post date:** [February 4, 2024, 4:02pm UTC](https://forum.inductiveautomation.com/t/find-a-component-property-in-a-different-window-and-that-is-inside-a-group/85202/3 "2024-02-04T16:02:24Z")

</div>

Thank you for your reply. What I want to do is change the visible property of a rectangle. The rectangle is in a dock window, so my idea is to change the visibility of the rectangle when a certain window is open. I'm placing the code in a `VisionWindowOpened` event, and this is the window that will change the visibility of my rectangle. However, when I open the window in the client, a system warning appears, showing a script error related to `VisionWindowOpened` .

this is the code:

```auto
window = system.gui.getWindow('Docked Windows/Electrical Trend Menu')
group = window.rootContainer.getComponent("Group 36")
group.getComponent("Rectangle 1").visible = False

```

I tested the code in script console and it seems is working good, i do not know why in the VisionWindowOpened is not working as well

---

<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:** [February 4, 2024, 4:05pm UTC](https://forum.inductiveautomation.com/t/find-a-component-property-in-a-different-window-and-that-is-inside-a-group/85202/4 "2024-02-04T16:05:19Z")

</div>

> [@david\_rafael\_ulloque](#):
>
> showing a script error

Show the error. Be sure to obtain the full details, via the clipboard, and paste the entire traceback here using "preformatted" styling.

{ Be aware that VisionWindowOpened is an event that runs very early in a window's lifecycle, before everything is initialized, so breakage is common. }

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [February 4, 2024, 11:10pm UTC](https://forum.inductiveautomation.com/t/find-a-component-property-in-a-different-window-and-that-is-inside-a-group/85202/5 "2024-02-04T23:10:41Z")

</div>

> [@david\_rafael\_ulloque](#):
>
> What I want to do is change the visible property of a rectangle

Now that we know this, I would say that direct scripting is probably not the correct approach. Scripting with `getWindow` will only work if the window is already opened, and if the window is in another desktop, it gets more complicated.

A simpler approach would be to use a client tag. Bind the visibility property of your rectangle to the tag value, and write `True` to the tag using the Vision window opened event, and conversely write `False` to the tag on close.
