Custom application settings

Another approach, if you don't want to do the file reading/writing yourself (and only have simple string keys to store)

You could use the technique Kevin outlines in this post:

To set up arbitrary system properties (they can have whatever name you want) and then retrieve them in scripting via system.util.getProperty.

I'd use Phil's approach if you need to store anything more complex than a handful of top-level variables that are strings or can be easily type-coerced from string, like booleans/integers.

2 Likes