# Anyway to cycle through screens automatically?

**URL:** <https://forum.inductiveautomation.com/t/anyway-to-cycle-through-screens-automatically/8639>\
**Category:** Ignition\
**Created:** [June 30, 2014, 12:09pm UTC](https://forum.inductiveautomation.com/t/anyway-to-cycle-through-screens-automatically/8639 "2014-06-30T12:09:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbackus](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tbackus/32/5091_2.png) [@tbackus](https://forum.inductiveautomation.com/u/tbackus)\
**Post date:** [June 30, 2014, 12:09pm UTC](https://forum.inductiveautomation.com/t/anyway-to-cycle-through-screens-automatically/8639/1 "2014-06-30T12:09:51Z")

</div>

I have several “overview” screens built, is there a way to cycle throught these screens every 5 minutes??

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [June 30, 2014, 2:01pm UTC](https://forum.inductiveautomation.com/t/anyway-to-cycle-through-screens-automatically/8639/2 "2014-06-30T14:01:40Z")

</div>

A Client Timer Script could be written to automatically open and close the appropriate windows.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [June 30, 2014, 3:25pm UTC](https://forum.inductiveautomation.com/t/anyway-to-cycle-through-screens-automatically/8639/3 "2014-06-30T15:25:15Z")

</div>

Below is a Client Timer Script that automatically swaps the current maximized window. Set the Client Timer Script to run every 5 minutes.

```auto
swapWindows = {"Window 1":"Window 2","Window 2":"Window 3","Window 3":"Window 1"}
win = system.nav.getCurrentWindow()
nextWindow = swapWindows[win.name]
system.nav.swapTo(nextWindow)
```

---

<div class="post-metadata">

**Author:** ![tbackus](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tbackus/32/5091_2.png) [@tbackus](https://forum.inductiveautomation.com/u/tbackus)\
**Post date:** [July 31, 2014, 1:24pm UTC](https://forum.inductiveautomation.com/t/anyway-to-cycle-through-screens-automatically/8639/4 "2014-07-31T13:24:54Z")

</div>

Just got a chance to try this and unfortunately it does nothing, opens the first screen then never changes…

`swapWindows = {"Main QA Overview":"Calendar","Calendar":"Main Window","Main Window":"MISC","MISC":"Quality Alerts","Quality Alerts":"Robot Overview","Robot Overview":"Main QA Overview"}
win = system.nav.getCurrentWindow()
nextWindow = swapWindows[win.name]
system.nav.swapTo(nextWindow)`

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [July 31, 2014, 1:51pm UTC](https://forum.inductiveautomation.com/t/anyway-to-cycle-through-screens-automatically/8639/5 "2014-07-31T13:51:40Z")

</div>

Okay, you will have to debug it then. Change the timer script to run every 10 seconds or so. Open the Output Console to see if any errors are occurring.

Print out the value of win and nextWindow in the script. Find out what is happening.

Are any of your windows in any directories?

---

<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 16, 2019, 8:29pm UTC](https://forum.inductiveautomation.com/t/anyway-to-cycle-through-screens-automatically/8639/7 "2019-08-16T20:29:05Z")

</div>

Not a good idea. That will lock up your windows for five seconds at a time. Neither python’s nor java’s sleep functions are safe on the foreground (gui) thread.
