% % insure tracker data channel running % 0 !Sim.Next { *traknext ? % % see if data reception nodejs window is running % "app" _Sim.UniqueName lower & &" tracker" "ConsoleWindowClass" % % identify the comm sender's browser window % % stack: document-title window-class % *indyfinf % % optional items included if window exists % stack: [ handle ] [ full-name ] [ class ] exists % { !JS.Class !JS.Caption !JS.Handle % % already have data receptor running % "end_" &_Sim.UniqueName text ofconn exists { % % turn off data receptor % _JS.Handle Win.Close pop } if } { % % no such data nodejs, start it % "end_" &_Sim.UniqueName text ofconn exists { % % do not turn on data receptor % } { % % create the command file and nodejs .js file % "Factory" ofbin folder !Act.Source "appaa01xx.cmd" ^_Act.Source read "{{tracklow}}" _Sim.UniqueName lower replall "app" _Sim.UniqueName lower & &".cmd" ^_Act.Source write "appaa01xx.js" ^_Act.Source read "{{baseport}}" 1328 replall "{{index}}" _Sim.UniqueName 2 right 0 add replall "{{port}}" _Sim.UniqueName 2 right 1328 add replall "{{tracker}}" _Sim.UniqueName replall "{{suffix}}" _Sim.UniqueName 2 right replall "app" _Sim.UniqueName lower & &".js" ^_Act.Source write "Factory\" ofbin &"app" _Sim.UniqueName lower & &".cmd" quoter % % stack: node-cmd % *runsminf } ifelse } ifelse } loop