Caching windows on StartUp

I have a number of layouts that need to be opened, closed, and cached on Startup so they don’t bog the project down when switching between them.
I have set these windows caching to ALWAYS.
I also thought the method to do this would be to open these windows on startup and run a StartUP client script to close each one of them… Sometimes the script misses closing ALL of the windows though.
How should I pull this off?

When you are closing the windows, are you looping through the opened windows or closing a static list? You might have to close the windows after a few seconds or so, something like:def doLater(): import system system.nav.closeWindow("WindowName1") system.nav.closeWindow("WindowName2") system.nav.closeWindow("WindowName3") .... system.util.invokeLater(doLater, 5000)That will do it after 5 seconds.

This seems to work okay. Sometimes I get stuck in one of the windows I want to close affter my startup so I changed the timer to 10 seconds and haven’t yet had an issue but I was wondering if it’s possible to wait until all windows have been loaded before executing all the close scripts in order to make certain I am not prematurely firing this script before the windows have been loaded.

You can probably look at:windows = system.gui.getOpenedWindowNames() print len(windows)You can see how many are in the list or loop through them.

ok, using this just seems to lock up my client or lock it up after saving the project,

import system windows = system.gui.getOpenedWindowNames() while len(windows) != 2: system.nav.closeWindow("1") system.nav.closeWindow("2") windows = system.gui.getOpenedWindowNames()
I want to close everything except the Header and main page.

Try printing out the list of windows to see why it gets stuck.

sometimes just closing the list of windows in the
def doLater called after 10 seconds does this.

Launches the client.
opens the windows
closes the entire client.

I’ve seen this twice but can’t explain why it happens unless it’s hitting up too much memory on my server having all these windows open at once.

If this is the case then I suppose I would have to stagger the open/close process to open and close them one at a time or something.
it took me 6 minutes to open/close 9 windows :frowning:

Seems like you’re jumping through hoops to cache all your windows, but then your client is running out of memory.

Have you thought about upgrading the client machine to increase performance?

Are you connecting over a particularly low bandwidth connection? Do you have large graphics or anything else that takes up a lot of data embedded in your windows? Any particularly slow queries? This raises the red flag that other bigger problems may exist.