Interacting with screens while in a script

I have a script that performs multiple tasks. I created a popup screen that lists the tasks and want to show the user the status of each one so that they know how much progress is being made. What I have run into, is that the popup window does not appear until after the script completes which is not what I was looking for.

Does anyone know how to do what I am trying to do?

How is your script set up? Are you calling openWindow() on the popup, and then interacting with components on that window?

Yes, I am. I am opening a window which has one component (a Table). And I am interacting with it Here is a portion of my code.

system.nav.openWindow(‘Window’)
system.nav.centerWindow(‘Window’)
statwin = system.gui.getWindow(‘Window’)
stattable = statwin.getRootContainer().getComponent(‘Table’)
for ind in range(1, 7):
asmlstg = ‘ASML0’ + str(ind) + ‘: Sending communicate’
stattable.addRow([’’,asmlstg])

Where Window is the popup window.

Yeah, that script looks fine, it should open the popup and then add rows to the table. I’m guessing the effect your seeing is repaint() being called on the popup after the script is executed, but this wouldn’t be noticeable unless you’ve got some other scripts that are blocking the UI thread after calling openWindow(). I guess my question is, how exactly is this affecting what you’re trying to do?

Within my script, I am making several calls to urlopen and parsing the results of the call using minidom. At the beginning of the script, I want to create the status window that I trying to open and populate it with all of the commands that will be sent. As each command completes, I want to update the popup window that the command was complete. Since this script takes several seconds to run, I want to be able to let my users see how much of the command has completed and how much is still left to do. Kind of like a check off list as the script progesses.

I never see the popup window until after the script completes processing.

I think you need to use invokeLater() so that the window is on the screen before you run the other part of the script:

inductiveautomation.com/support/ … elater.htm

You’ll want a setup similar to this:

[code]system.nav.openWindow(‘Path/To/Window’)
system.nav.centerWindow(‘Path/To/Window’)

def later():
# do markup parsing

system.util.invokeLater(later)[/code]