This is a short example - you can just create a new LocalScript (don't forget to add it to the HMI!) and replace the module.run() code by this block: module . run = function ( self ) { const im = shmi . visuals . session . ItemManager ; const myItemHandler = im . getItemHandler (); myItemHandler . setValue = function ( value ) { console . log ( "The value of the item has been set to " + value ); if ( value == 1 ) { let p = [{ name : "notify" , params : [ "This dialog was triggered by a UI Action!" , "UI Action Dialog" ] }]; new shmi . visuals . core . UiAction ( p ). execute (); // close Dialog } }; const subscriptionToken = im . subscribeItem ( 'SInt' , myItemHandler ); /* called when this local-script is disabled */ self . onDisable = function () { self . run = false ; /* from original .onDisable function of LocalScript control */ subscriptionToken . unlisten (); }; }; This will show a dialog whenever the Item "SInt" changes to 1.
... View more