(UXP script) ScriptMenuActions method addEventListener rejects handler as not function
I am trying to convert a working ESTK script to InDesign UXP one. It should use the menu.
A new menu item can be added without errors.
The error occurs when registering the "beforeDisplay" and "onInvoke" event handlers with the addEventListener method.
Error:
Invalid value for the "handler" parameter of the add method. Expected File or JavaScript Function but got () .
Then I took the BeforeDisplay.jsx file from the latest version of the SDK for testing and renamed it to BeforeDisplay.idjs. The line #targetengine had to be commented.
The error is the same. The event handler could not be registered.
