# Scripting Problem

**URL:** <https://forum.inductiveautomation.com/t/scripting-problem/17977>\
**Category:** Ignition\
**Created:** [May 9, 2018, 8:00pm UTC](https://forum.inductiveautomation.com/t/scripting-problem/17977 "2018-05-09T20:00:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanastiefes](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@ryanastiefes](https://forum.inductiveautomation.com/u/ryanastiefes)\
**Post date:** [May 9, 2018, 8:00pm UTC](https://forum.inductiveautomation.com/t/scripting-problem/17977/1 "2018-05-09T20:00:43Z")

</div>

I am currently programming a 7.7.5 system and using a string literal in a script to open a window from a template.

Here is my script:

popup = “Popups/%s/ToD Setpoints” %event.source.parent.Sites.PopupFolderName  
window = system.nav.openWindow(popup)  
system.nav.centerWindow(window)\

I get the error:

Traceback (most recent call last):

File “event:actionPerformed”, line 7, in

ValueError: Window Popups//ToD Setpoints does not exist.

Is this a bug in 7.7.5? I’m currently using this same exact script in 7.8.x. Any work arounds?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 9, 2018, 8:07pm UTC](https://forum.inductiveautomation.com/t/scripting-problem/17977/2 "2018-05-09T20:07:42Z")

</div>

> Window `Popups//ToD Setpoints` does not exist

means that the string replacement is inserting null - so `event.source.parent.Sites.PopupFolderName` is not populated with anything.

---

<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 9, 2018, 8:08pm UTC](https://forum.inductiveautomation.com/t/scripting-problem/17977/3 "2018-05-09T20:08:02Z")

</div>

Is there anything that could be making PopupFolderName change? That looks fine code-wise, its having an issue because the %s in popup assignment is, for some reason, coming up blank.

One thing I’m wondering about, is what is “Sites”? Seems odd that you’re calling that and then something in that. Sites isn’t a normal field name so its a custom field, and I don’t think theres any custom field types that have a property of its own like that. Maybe sites is a component and PopupFolderName is a property of it? Use .getComponent(“Sites”) instead of just .Sites to get that, in that case.
