Access Java classes from Python

I want to build a popup menu with parameters from other windows. The system.gui.getWindowsNames() gives me a list of windows. When I try to use system.qui.getWindow() it rises an exception saying that window is not opened.

I need some custom properties from the root container of these windows.

I found that WindowInfo.getWindowInfo() from com.inductiveautomation.factorypmi.application.model package can give me some information about a window. Is it posible to use it and if so, then how? I don't know what to import to get access to WindowInfo class.

The root container doesn't exist if the window isn't open. So, no, you cannot do this. I recommend you create a constant in a library script to supply the information when the windows are closed. Consider using a script in the designer to open all of the windows of interest, then another to collect this information and output it in the script console with repr(). That should be close to what you need for the library script constant.

1 Like

I decided to use a dataset as it looks like easiest way.

But there should be answer because the information exists in the window object even it is not opened. The question is how to access it.

Thank you for your help.

It is in a compressed, serialized, binary format that is only decoded by opening (because the decoding process actually instantiates the components).

So, no, you cannot access the information without opening the window(s).