Expression Binding runScript vs. Property Change Script

Yes. Long ago. I created the objectScript() expression function in my Simulation Aids module to address the limitations of runScript(). I, too, like some scripting to always work in the designer.

FWIW, runScript() was later upgraded to include ‘self’ in scope of component bindings, and to pass extra arguments if the given python expression yields a function name. I got credit in the release notes. (:

Anyways, the remaining differences:

  • objectScript() can do extra arguments in a self-contained expression,
  • objectScript() exposes the binding for arbitrary re-triggering. (polling)
  • objectScript() exposes a long-lived state dictionary, handy for computing deltas and/or sums.
  • objectScript() can get the target property name (where applicable) from the binding.
1 Like