# Vision client timer script with parameters passing between windows

**URL:** <https://forum.inductiveautomation.com/t/vision-client-timer-script-with-parameters-passing-between-windows/78410>\
**Category:** Ignition\
**Tags:** vision, scripting\
**Created:** [August 25, 2023, 8:16pm UTC](https://forum.inductiveautomation.com/t/vision-client-timer-script-with-parameters-passing-between-windows/78410 "2023-08-25T20:16:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shaun\_Letts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/shaun_letts/32/47572_2.png) [@Shaun\_Letts](https://forum.inductiveautomation.com/u/Shaun_Letts)\
**Post date:** [August 25, 2023, 8:16pm UTC](https://forum.inductiveautomation.com/t/vision-client-timer-script-with-parameters-passing-between-windows/78410/1 "2023-08-25T20:16:31Z")

</div>

Hi all, first post, as I can't find exactly what I'm looking for in the forums. The goal here is wanting essentially a 'screen saver' window popup after about 3 minutes of inactivity on my HMI screens. These are industrial dryers, and it was requested that a screensaver popup with the dryer number and dryer fill percentage, until an operator touches the screen. These screens start up with options for 3 dryer numbers, indicating what dryer is being operated, then that is passed into the 'main' screen as a root container property.

The screensaver window itself was made as a 'main' screen, as that should automatically be full screen, and no borders, but if that is my problem, I can alter it.

I initially set up a client timer script, and tried to grab the property by calling on the getWindow, to then grab the component 'dryerno', which is an int, as a property of the 'main' screen.

```auto
window = system.gui.getWindow('Main')
dryernumber = window.getRootContainer().getComponent('dryerno')

if system.util.getInactivitySeconds()>180 and system.nav.getCurrentWindow()!='Screensaver':
	system.nav.swapTo('Screensaver', {'dryerno' : dryernumber})

```

Under the logs, it sees that "main" is not currently open when I push this into production, but I assume the reason for that is that it already sees inactivity has met or exceeded my 'if' statement, but this was a means to get the screen to popup, and I would just normally put a 'try' and 'catch' around my variables. The window does popup, but it will not pass the property value, and interacting with the screen does not close the window. I wasn't sure if the window would close on its own because the criteria of my 'if' statement will have not been met if there was activity, or if I needed another method by which to automatically close the window.

I have also tried adding a '.value' on the dryer number assignment, and it didn't work.

So main questions are:  
Am I going about this the right way using a client timer script?  
What is the best way to pass the dryer number property if this is the way?  
Do I need to make another statement to close my 'screen saver' with activity?

---

<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:** [August 25, 2023, 8:25pm UTC](https://forum.inductiveautomation.com/t/vision-client-timer-script-with-parameters-passing-between-windows/78410/2 "2023-08-25T20:25:20Z")

</div>

When you swap windows, the prior window is closed as the new one is opened, so you are losing access to its contents. If you search for `JFrame` here, you should find some alternatives that will cover the screen without actually swapping.

---

<div class="post-metadata">

**Author:** ![Shaun\_Letts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/shaun_letts/32/47572_2.png) [@Shaun\_Letts](https://forum.inductiveautomation.com/u/Shaun_Letts)\
**Post date:** [August 25, 2023, 8:36pm UTC](https://forum.inductiveautomation.com/t/vision-client-timer-script-with-parameters-passing-between-windows/78410/3 "2023-08-25T20:36:56Z")

</div>

I will search that up. Thank you very much!

---

<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:** [August 26, 2023, 10:34pm UTC](https://forum.inductiveautomation.com/t/vision-client-timer-script-with-parameters-passing-between-windows/78410/4 "2023-08-26T22:34:26Z")

</div>

It would probably be simpler to overlay the entire window with a container component. You could put the dryer number and anything else you need into the container, and control the container's visibility with a timer script or with a with a timer component placed somewhere in the window.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [August 27, 2023, 1:05am UTC](https://forum.inductiveautomation.com/t/vision-client-timer-script-with-parameters-passing-between-windows/78410/5 "2023-08-27T01:05:24Z")

</div>

Similar vein, but in Vision I used to add a semi-transparent black rectangle at the highest z order which had a click action that did nothing in it. When I wanted a modal popup, I used a client tag as it's visibility. The click action would also turn the client tag off if background dismiss was needed. I would much prefer something like that over adding the same screensaver container to each page. But if you can do this through Java it would be even better, more complex though for the average Joe

---

<div class="post-metadata">

**Author:** ![Shaun\_Letts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/shaun_letts/32/47572_2.png) [@Shaun\_Letts](https://forum.inductiveautomation.com/u/Shaun_Letts)\
**Post date:** [August 29, 2023, 12:26pm UTC](https://forum.inductiveautomation.com/t/vision-client-timer-script-with-parameters-passing-between-windows/78410/6 "2023-08-29T12:26:19Z")

</div>

Thanks for this reply, by the way. As I ended up using a container with a timer script for it, as it wasn't going to be using many resources to maintain, even in the background. So I ended up using this for now. Thanks!
