VBScript API Notes
The VBScript API is similar to the C# method. The following examples illustrate:
GetControls method will return an array of objects, The call of this API cannot be automatically generated by the model manager, and requires user to write it manually in the code as needed.
Here we use SimpleStyles an example, add model objects for following checkbox controls.
Below is the corresponding model
Run the following code in LeanRunner:
Dim auto
Set auto = CreateObject("Win.Automation")
Dim model
Set model = auto.LoadModel("C:\\temp\\SimpleStyles\\Model1.tmodel")
Dim controls
controls = model.getControls("Normal")
Dim summary
MsgBox(LBound(controls) & " " & UBound(controls))
For i = 0 to UBound(controls)
summary = summary & vbCrLf & controls(i).name
Next
MsgBox(summary)
And you will get the following output result:
Normal
Checked
Indeterminate
CheckBox
You can notice that all checkboxes are retrieved.