This is code from Screenshot Sender to enumerate controls it could be altered to do what you would need it to do:
js code:
/*
Name: EnumControls
Purpose: Enum the controls from a specified window
Parameters: File - The name of the file
pPlusWnd - The Plus! window object
Return: None
*/
function EnumControls ( File , pPlusWnd ) {
_debug.getfuncname ( arguments ) ;
// Load the XML from the specified file
var XML = new ActiveXObject ( 'MSXML.DOMDocument' ) ;
XML.load ( File ) ;
// Loop through all of the controls
var Controls = XML.selectNodes ( '/Interfaces/Window [ @Id='' + pPlusWnd.WindowId + '' ] /Controls/Control' ) ;
for ( i=0 ; i<Controls.length ; i ++) {
var Id = Controls [ i ].getAttribute ( 'Id' ) ;
var Type = Controls [ i ].getAttribute ( 'xsi:type' ) ;
// Get the value depending on the control's type
objControls [ Id ] = {} ;
objControls [ Id ].XsiType = Type ;
objControls [ Id ].Value = pPlusWnd_GetControlvalue ( pPlusWnd , Id , Type ) ;
}
}