# Multiple Monitor Script w/ Header/footer

**URL:** <https://forum.inductiveautomation.com/t/multiple-monitor-script-w-header-footer/54681>\
**Category:** Ignition\
**Created:** [January 5, 2022, 3:42pm UTC](https://forum.inductiveautomation.com/t/multiple-monitor-script-w-header-footer/54681 "2022-01-05T15:42:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Taylor.Johnson](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@Taylor.Johnson](https://forum.inductiveautomation.com/u/Taylor.Johnson)\
**Post date:** [January 5, 2022, 3:42pm UTC](https://forum.inductiveautomation.com/t/multiple-monitor-script-w-header-footer/54681/1 "2022-01-05T15:42:22Z")

</div>

Good morning all! I have a project that uses the following startup script to get an ignition display on each monitor. The problem I am having is that when I tried to use this script to pop up my header/footer and a main page - it seemed to completely break. The only way I could get around this was to change all my main displays to include the header/footer

Does anyone have advice on how to make this work?

Existing script:

 ![remmina_EWS Remote_192.168.40.151_20220105-154149](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/1/21aa614acf6ea84b721a01185633811af5512d95.png)

---

<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:** [January 5, 2022, 4:23pm UTC](https://forum.inductiveautomation.com/t/multiple-monitor-script-w-header-footer/54681/2 "2022-01-05T16:23:08Z")

</div>

Can you post your code as text, inside preformatted text blocks?  
```python  
-your code here-  
``​`

Also, what does ‘completely breaks’ mean - are any errors displayed?

---

<div class="post-metadata">

**Author:** ![Taylor.Johnson](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@Taylor.Johnson](https://forum.inductiveautomation.com/u/Taylor.Johnson)\
**Post date:** [January 6, 2022, 3:11pm UTC](https://forum.inductiveautomation.com/t/multiple-monitor-script-w-header-footer/54681/3 "2022-01-06T15:11:40Z")

</div>

Yes sorry Ill do that! I meant to get a screenshot of the problem but got side tracked yesterday. It doesnt error out, just stacks all 3 displays on each other and distorts the sizing if I remember correctly. Ill get a screenshot

---

<div class="post-metadata">

**Author:** ![Taylor.Johnson](https://avatars.discourse-cdn.com/v4/letter/t/c68b51/32.png) [@Taylor.Johnson](https://forum.inductiveautomation.com/u/Taylor.Johnson)\
**Post date:** [February 23, 2022, 2:49pm UTC](https://forum.inductiveautomation.com/t/multiple-monitor-script-w-header-footer/54681/4 "2022-02-23T14:49:03Z")

</div>

```auto
# Get the screen information for all of your monitors.
screensDataset = system.gui.getScreens()
  
# Open the first window of the project in the (current) primary monitor.
screenIndex = screensDataset[0][0]
monitorNum = screenIndex + 1
primaryScreenText = 'This is Monitor %d' %monitorNum
system.nav.swapTo('Dry Plant Overview', {'Display':primaryScreenText})

# Step through all of the screen information, starting with index 1 instead of 0.
for screenDetails in screensDataset[1:]:
    # unpacks the tuple that is returned for each of the monitors present. Consists of screen index, width, and height of the screen.
    screenIndex, screenWidth, screenHeight = screenDetails
    monitorNum = screenIndex + 1
    screenText = "This is Monitor %d" %monitorNum
  
    # Open an empty frame on the next monitor.
    # Assign a handle and apply the width/height for the monitor you are opening on
    handleName = "Monitor %d" %monitorNum
    system.gui.openDesktop(screen=screenIndex, handle=handleName, width=screenWidth, height=screenHeight)
  
    # Open the Main Window on this new desktop and pass the parameters needed.
    system.nav.desktop(handleName).openWindow('Loadout', {'Display':screenText})
    system.nav.desktop(handleName).openWindow('Footer-1080P', {'Display':screenText})
    system.nav.desktop(handleName).openWindow('Header-1080P', {'Display':screenText})

```

I was able to fix this - the problem was I was using the “swapto” command instead of the “openwindow” command. All works now!
