Lua Scripts vs. Scripting

Hi team,

There’s something I find confusing when using the LUA scripts binding to actions/buttons

  1. I use the Windows/Scripting environment to create and register some new Action scripts
  2. I use the Edit/LUA Scripts/Script Manager to bind them to actions
  3. Everything works as expected (I’m launching the actions via OSC)
  4. I go back to the Windows/Scripting environment and change+save one of my actions
  5. If I run the action again, it’s still the old code being executed :thinking:
  6. Clicking Edit in the Edit/LUA Scripts/Script Manager does show the old code (in a scratch buffer slot)
  7. To get it to work, I have to remove my action declaration and rebind it

I don’t expect to be doing this changes to the scripts code often but out of curiosity, is there a design reason behind this apparent disconnect ?

Cheers and happy holidays !

The script is compiled to bytecode.

The factory functions run, arguments passed to the factory are evaluated and the produced bytecode is saved with the session. The main motivation for this is compatibility.

An old session will use the script of the session, and not a potentially incompatible updated script from disk.

I see
Thanks for the explanation Robin; makes sense

Or a broken one because you were still half way through making changes to it when you loaded a session that uses it. Very good.

It would be nice to have some kind of refresh-all-from-disk function/action. So a session could be updated to the latest version of all scripts it uses, auto-remembering where to find them and what parameter values were used when they were added last time. Would this be possible?