Mutli-Monitor to show 4 different Display

If this is a continuation of the question you asked here:

You'll need to read in the tag values then use that array to open the last displays:

windowList = system.tag.readBlocking(['OpenedWindows'])[0].value

So your code would look something like this (replace the AMINE/AMINE GAS TRAIN windows with what ever default window you want on all monitors or use a mix of this and what @leonardo.godoi posted if you want different defaults per desktop - I usually just set them all the same since we're restoring last used and the default only matters the first time the client is ran):

# Get the screen information for all of your monitors.
screensDataset = system.gui.getScreens()

# Retrieve our previously opened windows
windowList = system.tag.readBlocking(['OpenedWindows'])[0].value
  
# 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

windowToOpen = windowList[0] if len(windowList[0]) > 0 else 'AMINE/AMINE GAS TRAIN'
system.nav.swapTo(windowToOpen, {'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.
    windowToOpen = windowList[monitorNum] if len(windowList[monitorNum]) > 0 else 'AMINE/AMINE GAS TRAIN'
    system.nav.desktop(handleName).swapTo(windowToOpen,{'Display':screenText})
1 Like