truespace open debug view

    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;
}

button notes

 

general notes for scripting buttons

var tbbutt = Node.Create(‘Windows Manager Package/Toolbar Button Item’, mytoolbar);
Node.Value(tbbutt, “ControlID2D”) = “{2BBC850E-6EEF-4364-9265-A4A606AE464B}”;//must be this guid
Node.Value(tbbutt, “ControlID3D”) = “{2BBC850E-6EEF-4364-9265-A4A606AE464B}”;
//Node.Value(tbbutt ,”Package”) = “{E0C3ABBA-AA1C-4A09-8089-9ED4A8AC63B9}”;//needed for menu button
Node.Value(tbbutt, “Menu”) = false;
Node.Value(tbbutt, “Name”) = theframeSN;
//Node.Value(tbbutt ,”Preview2D”) = 303;//needed for image button
//Node.Value(tbbutt ,”Preview3D”) = 303;
var tbbutt2 = Node.Rename(tbbutt, theframeSN + “Button”);