Window information

How do I get information to tag on which window is open.

Not sure if I can assign numbers to windows or just grab the names of them.

Reason being, I have a filter button on alarm banner. The banner is docked under ever system window, so I don’t want to use the selection filter for all since it will change for other clients to. What I what like to do is use visual appearance that when in a certain window, all others disappear and the local filter shows, I am pretty sure this involves script.
you can see below a pic on the selection button.

Integrator of other project does a lot of database query, which helps out any client picking what they want. I am not set up like that on my project, so I will still take the alternative route, any suggestions please on what I state on first post?

system.gui.getOpenedWindowNames() will give you the full path (folders and name) of all open windows.

Where do I put this at?
Can you give me an example please. ( )<< is this were I would put a string or some thing ?

Follow the link in my previous post for details of the function. If I’ve understood your usage correctly, you could probably put the script to get the window names and then make changes to your alarm display according to what you find there on a property change event on a timer component added to your alarm display.

This worked, and is kind of what I want. The script is writing 1 or 0.

Lets say I have 2 screens motor and Lights
so this means I will have 2 of this components
one for each screen, now when on motor screen one of them will appear and if on lights screen the other one will appear.

I can use the script, but wan to some how add the path and bind it to properties

Under visible. I cant use a memory tag because it will change other clients, but if can some how to to properties of that component and write to it, that would be good
I tried and this is the script

did not work. the first script worked writing 0 and 1, but the second one true or false did not.

You don’t need the quotation marks around True or False (or numbers) in system.tag.write(tag, value). Quotation marks are used around string values, not boolean or numerical values.

It looks like you are using a client timer script. You could use this to write to a client tag (unique per client) and then bind it to the visible property.

To write to the components directly, you would use something like this function to get a reference to the window and then drill down to the object: https://docs.inductiveautomation.com/display/DOC79/system.gui.getWindow.

I did not know there was a folder for clients and I can only make client tags there . Man, I suffered. But learned.
I am almost done with this. Thank you so much.

1 Like

well I don’t need any script, LOL. The client tags that I created lets clients sort on whatever alarm they want. well I learned some new script!!

1 Like

The tag at [System]Client/User/CurrentWindow contains the path of the currently open main window, and it will automatically update when the main window is changed. Instead of running scripts on timers you can bind the visibility of your dropdowns with simple expressions:

{[System]Client/User/CurrentWindow} = "Main/Config/1 Fenceline East Diagnostics"

That system tag will not tell you anything about pop up windows, though, so it can’t be used if you need to know about open pop ups.

1 Like

I am using this tag for current window, but i see it don’t change in client , I assume it using the window name i gave it. I did copy windows for and renamed them.
here is a screen shot of the script that should only exit when in those windows, but it exits on all windows.