Lua Scripts


I am trying to use two lua scripts and have the entry in the
orthanc.json configuration file as :

"LuaScripts" : [

I have tested script_one.lua by itself and it worked without a problem.

When I added script_two.lua as per above, script_one.lua apparently
failed to activate, but script_two.lua worked fine.

In trying to figure out what happened I noticed that the verbiage in
the config file above the lua scripts states that only the paths should
be in the bracket's and not the file name. Is this correct?

// List of paths to the custom Lua scripts that are to be loaded
// into this instance of Orthanc

Does this in fact mean that once the path is set in the orthanc.json
config file orthanc will execute all the scripts in the appropriate


Greg Ennis

Your syntax looks correct.
Are you sure you don’t define twice the same calback in both files ? I.e, If you define OnStableStudy in both lua files, I’m almost sure that only one will be called.


Thank you for your help!!!

I am using 'OnStoredInstance(instanceId, tags, metadata)' in each lua
script. Does this function have the same requirement to be used only

Hello, yes, “OnStoredInstance()” must only be defined once.



Thanks much, I merged both scripts into one script, and was able to make things happen appropriately,