Changing Text Style Properties On-The-Fly?

Is it possible to change Text Style properties on-the-fly? On our system, the menu bar background color changes everytime you login, but it would still be nice to use a text style that we set at the beginning of all of our scripts. I’m trying to do something like the following:

Set the CurrentTextPlatform.Styles.MenuBar.TextBackgroundColor to MenuBarBackgroundColor

where MenuBar is an existing text style and MenuBarBackgroundColor is an existing variable with a color value. I’ve been trying to do this and the MenuBar text style doesn’t seem to be holding the TextBackgroundColor value.

The goal of this is to avoid having to write (Text:“File”,TextBackgroundColor:MenuBarBackgroundColor) everytime we need to access a menu bar, so if you have a suggestion that you think might work other than trying to change the text style, I’d appreciate hearing it.

In my tests your approach seems to work. You’re setting a global variable, so the change won’t persist between script runs – you can’t execute that code once and have any script you run afterwards use that value, but if you execute that code during the run of a script that calls other scripts, any Text Image that uses that style should use the background color that you set. The settings that are in the Text preferences are going to be loaded when a script is run and can be overridden, but changing those values in code will not propagate back to the values in the preference panel.