# How to open a window from a template object using scripting

**URL:** <https://forum.inductiveautomation.com/t/how-to-open-a-window-from-a-template-object-using-scripting/12267>\
**Category:** Ignition\
**Created:** [October 21, 2016, 2:00pm UTC](https://forum.inductiveautomation.com/t/how-to-open-a-window-from-a-template-object-using-scripting/12267 "2016-10-21T14:00:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cblische](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@cblische](https://forum.inductiveautomation.com/u/cblische)\
**Post date:** [October 21, 2016, 2:00pm UTC](https://forum.inductiveautomation.com/t/how-to-open-a-window-from-a-template-object-using-scripting/12267/1 "2016-10-21T14:00:29Z")

</div>

I am trying to open a window when i click on a Label object in my template. My template has a string parameter for path\_location and for window\_name. I type these in to the template object when I drop it on the screen. That is all fine. My problem is trying to use scripting to create the window name string value in my code. I am very new to python and passing in data so i’m sure it is probably something simple. Want something like this:

\*\*\*\*\*\*\*\*This is the line i don’t know how to create  
window\_string = [color=#BF0000]template.path\_location[/color] + “/” + template.window\_name

* * *

window = system.nav.openWindow(window\_string)  
system.nav.centerWindow(window)

I’m not sure how to get the path\_location string value inserted into the above section. Does it have to be an indirect path? Is there some python object that grabs the template name? … not sure

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![cblische](https://avatars.discourse-cdn.com/v4/letter/c/b5a626/32.png) [@cblische](https://forum.inductiveautomation.com/u/cblische)\
**Post date:** [October 21, 2016, 2:22pm UTC](https://forum.inductiveautomation.com/t/how-to-open-a-window-from-a-template-object-using-scripting/12267/2 "2016-10-21T14:22:14Z")

</div>

Figured it out.

value = event.source.parent.unit\_screen\_name  
window = system.nav.openWindow(value)  
system.nav.centerWindow(window)

Figured it was easy enough.
