Using VBScript

One of the most powerful features MouseRobot is an integrated programming language VBScript.

Basically, VBS-scripts are used for a data processing, system management, working with user accounts and computers, interaction with business applications, working with databases and other complex tasks.

MouseRobot is able to run a program in VBScript. This will allow you to significantly expand the scope MouseRobot and automate tasks of high complexity.

Add to the MouseRobot task the step "Program" to use VBScript.

Step Program

VBScript program can be easily integrated into any task MouseRobot and may influence the course of implementation. The main way of an interacting with MouseRobot is setting the values of variables. These values can be handled by other steps, such as "Condition (If ... Else)", used in the formation of results and for other purposes. Interaction with MouseRobot provided with Evaluate and SetValue functions.

Getting value of MouseRobot variable or expression

Evaluate function allows you to calculate the value of a variable or expression value.


Getting the name of the latest found object:

Dim name
name = WScript.Evaluate("{ControlName({LastControl})}")
MsgBox "Last found object name is " + name

Suppose that in the previous step has been found "Start" button on the taskbar Windows. Then the next step:

Will lead to the information window (the result of a function call MsgBox)

Setting MouseRobot variables

SetValue function allows you to store a resulting value, a set of values or any other information in a variable MouseRobot.


Calculating an area of a circle.

Dim R
Dim a
R = WScript.Evaluate("{radius}")
a = 3.14 * (R^2)
WScript.SetValue "{area}", a

MouseRobot task:

The dialog for entering a circle radius:

The result dialog (an area of a circle with a given radius):

© AutomationBox 2005-2011