rollout r_Test "Some Rollout" ( local viewsCounter = 0 fn ShutdownMaxAndSystem = ( local numViews = 0 for i = 1 to batchRenderMgr.numviews do ( v = batchRenderMgr.GetView i if v.enabled==true do numViews+=1 ) viewsCounter+=1 if viewsCounter==numViews do ( DOSCommand ("shutdown -s") quitMAX #noprompt ) ) on r_Test open do ( callbacks.addScript #postRender "r_Test.ShutdownMaxAndSystem()" id:#jobShutdown ) on r_Test close do ( callbacks.removeScripts id:#jobShutdown ) ) CreateDialog r_Test 200 200