Lua script question

I’m trying to get a Lua script to execute on a Mac, however it doesn’t appear to be doing anything or being called. Any help appreciated.

The script is a bit longer but basically I’m doing the following:

function OnStableStudy(studyId, tags, metadata, origin)
    LogMessage("Study is stable. ID: " .. studyId)
end

My config looks like the following:

{
  "Name" : "MyOrthanc",

  "Plugins" : [ "." ],

  "OrthancExplorer2" : {
    "Enable": true,
    "IsDefaultOrthancUI": false
  },

  "LuaScripts" : [
    "./scripts/webhook.lua"
  ]
}

What if you try this:

Sorry, perhaps my example was misleading. LogMessage just calls print, so same effect. OnStableStudy doesn’t seem to be called, though I can see it in the changes feed.

Hello,

First of all, I would replace "./scripts/webhook.lua" with the full absolute path to the file, to first rule out any issue wrt the working folder.

More generally, I would add a LogMessage at the root of your script, to make sure that it is called and loaded correctly.

Also, supplying the logs in verbose mode could be interesting, too.

HTH

Hello,

By default, this event is only triggered after 60 seconds. Perhaps you have not waited long enough. Check out the StableAge configuration option of Orthanc.

Regards,
Sébastien-

I’m still not sure what I’m doing wrong, but I’ve decided to read the change log instead.

Thanks everyone.