How to access application constants in a script?

In a build script, how do I properly reference an application constant. The documentation doesn’t seem to give a good example.

For example, what’s the correct version of the following code?

If AppSupportsDarkMode <> "False" Then
  Speak("WARNING! Windows building in dark mode")
End If

Thanks!

You use ConstantValue and PropertyValue. Everything is stringly typed. There are lots of examples here on the forum. For instance:

if ConstantValue("App.kMaxVersion") = "1" then
  PropertyValue("App.MacOSXAppName") = "Mail Archiver X Pro"
  PropertyValue("App.Application Identifier") = "com.mothsoftware.mailarchiverxpro"

Thank you. Alas, I still can’t get the below to return anything other than false. I’ll keep trying.

If ConstantValue("App.AppSupportsDarkMode") = "True" Then
  Speak("WARNING! Darkmode is on for Windows")
End If

Try:

PropertyValue( "App.SupportsDarkMode" )

Regards, Charlie

Thanks Charlie. I had a typo of app.AppSupportsDarkMode plus needed to change to PropertyValue