Script testing a constant

if ConstantValue(“appid.klogon”) then
PropertyValue(“app.DefaultWindow”) = “win_csec_login_login”
else
PropertyValue(“app.DefaultWindow”) = “win_main”
end

I get a compile error on line 1, the rest works.

ConstantValue return a string
So if your constant is boolean you have to test against =“True”

Keep in mind that a non existent constant return an empty string (if you need to check this condition)

That worked, thanks.