if(!DebugViewFound("Project/Windows Manager Space")) CmdPrompt.DebugView('Windows Manager Space', 0); } function NodeSubObject(root, index) { return root + "/" + Node.SubObject(root, index); } function DebugViewFound() { var WMS = "Project/Windows Manager Space"; var numwindows = Node.SubObjectCount(WMS); for(var winIndex=0; winIndex < numwindows; winIndex++) { var currentWindow = NodeSubObject(WMS, winIndex); if(Node.SubObjectCount(currentWindow) < 1) continue; var shortname = Node.ShortName(NodeSubObject(currentWindow, 0)); if( shortname == "LogOutput") return true; } return false; }