There is a possibility to create variables when creating a script in Robin Studio. Open the "Resources" tab and switch to the "Variables" section to create variables.
The available variable types are described below:
- Hot keys
Data Type: Date-Time
Variable Description: This variable is used to store the date and time in the format dd-mm-yyyy hh:mm:ss.
Default Value (current computer time):
Example of Use:
Task: Create a variable of the «Date-Time» type and specify it in the «Modify Date» action.
Solution: Fill in the fields to create the variable.
When creating the variable, the «Value» parameter is filled by selecting the date and time from the opened window.
Specify this variable in the «Date» parameter of the «Modify Date» action.
When deleting the date and time value in the action parameter, an empty field will be displayed (the default date will not be shown).
- Date-Time
Data Type: Date-Time
Variable Description: This variable is used to store the date and time in the format dd-mm-yyyy hh:mm:ss.
Default Value (current computer time):
Example of Use:
Task: Create a variable of the «Date-Time» type and specify it in the «Modify Date» action.
Solution: Fill in the fields to create the variable.
When creating the variable, the «Value» parameter is filled by selecting the date and time from the opened window.
Specify this variable in the «Date» parameter of the «Modify Date» action.
When deleting the date and time value in the action parameter, an empty field will be displayed (the default date will not be shown).
- Collection
Data Type: Collection
Variable Description: This variable is used to store a set of values of one or several types. A collection can also be an element of another collection.
Default Value (on creation): Number of Entries = 0
Example of Use:
Task: Create a variable of the «Collections» type and specify it in the «Add element» action.
Solution: Fill in the fields to create the variable.
When creating a collection, you can choose the type for each of its values.
Specify the created variable in the «Collections» parameter of the «Add element» action.
- Point coordinates
Data Type: Point coordinates
Variable Description: This variable type contains the X and Y coordinates of a point on the screen.
Default Value (on creation): (0,0)
Example of Use:
Task: Create a variable of the «Point coordinates» type and specify it in the «Mouse click» action.
Solution: Fill in the fields to create the variable.
When creating the variable, you can enter the X and Y coordinates manually or automatically by clicking the «PickArea» button in the popup window.
Specify the created variable in the «Mouse click» action parameter.
- Boolean
Data Type: Boolean
Variable Description: This variable type contains the values True or False. A checked checkbox when creating the variable indicates that the variable will hold a true (True) value; otherwise, the variable will hold a false (False) value.
Default Value (on creation): False
Example of Use:
Task: Create a variable of the «Boolean» type and specify it in the «If» action.
Solution: Fill in the fields to create the variable.
Specify the created variable in the «If» action parameter.
- Range
Data Type: Range
Variable Description: This variable type contains the size and coordinates of a rectangular area.
Default Value (on creation):
Example of Use:
Task: Create a variable of the «Range» type and specify it in the «Modify range» action.
Solution: Fill in the fields to create the variable.
When creating a variable of this type, you need to specify the following parameters:
- X coordinate of the upper-left corner;
- Y coordinate of the upper-left corner;
- Height;
- Width;
The coordinates, width, and height can be filled manually or automatically by clicking the «PickArea» button.
Specify the created variable in the «Modify Range» action parameter.
- Object
Data Type: Object
Variable Description: A variable of this type can contain values of any type. When creating the variable and setting its value, you can choose any data type that will be stored in the variable. An «Object» type variable can store the result of an action of another type.
Default Value (on creation): Not applicable
Example of Use:
Task: Create a variable of the «Object» type and specify it in the «Add Object» action.
Solution: Fill in the fields to create the variable.
To fill in the value field, click the button, and in the popup window, specify the type and value.
Specify the created variable in the «Add object» action parameter.
- Password
Data Type: Password
Variable Description: A variable of this type contains password information.
Default Value (on creation): No password
Example of Use:
Task: Create a variable of the «Password» type and specify it in the «Send text» action (group «Browsers»).
Solution: Fill in the fields to create the variable.
After creating and saving the variable, its value cannot be viewed, and it is not displayed in the log. The value of a variable of this type is also not displayed during creation:
Specify the created variable in the «Send text» action.
- Folder path
Data Type: Folder path
Variable Description: A variable of this type contains the path to a specific folder.
Default Value (on creation): Not applicable
Example of Use:
Task:
Create a variable of the «Folder path» type and specify it in the «Rename Folder» action.
Solution:
Fill in the fields to create the variable.
An example of using this variable:
When creating a variable of the «Folder path» data type, a file explorer window is opened to select the folder, and the path to it will be saved in the variable.
Specify the created variable in the «Rename folder» action.
- File path
Data Type: File path
Variable Description: A variable of this type contains the path to a file.
Default Value (on creation): Not applicable
Example of Use:
Task: Create a variable of the «File path» type and specify it in the «Rename File» action.
Solution: Fill in the fields to create the variable.
When creating a variable of the «File path» data type, a file explorer window is opened to select the file, and the path to it will be saved in the variable.
Specify the created variable in the «Rename file» action.
- Dictionary
Data Type: Dictionary
Variable Description: A variable of the «Dictionary» type represents an array of data, unlike a collection, which works with keys and values rather than indices.
Each value in the dictionary can be accessed by its key. The value can be any of the types available in the studio.
Default Value (on creation): Number of Entries = 0
Example of Use:
Task: Create a variable of the «Dictionary» type and specify it in the «Add Object» action.
Solution: Fill in the fields to create the variable.
When filling in the variable value, you can specify the key, value type, and the actual value in the popup window.
Specify the created variable in the «Add object» action.
- String
Data Type: String
Variable Description: A variable of the «String» data type contains an arbitrary sequence of characters.
Default Value (on creation): Not applicable
Example of Use:
Task: Create a variable of the «String» type and specify it in the «Message» action.
Solution: Fill in the fields to create the variable.
When creating a variable of the «String» data type, you can enter the required text in the popup window.
Specify the created variable in the «Message» action.
- Table
Data Type: Table
Variable Description:
A variable of this type is designed to store data in the form of a table.
Default Value (on creation): Empty table
Example of Use:
Task: Create a variable of the «Table» type and specify it in the action parameter «Get message».
Solution:
Fill in the fields to create the variable.
Specify the created variable in the action parameter «Get message».
- Number
Data Type: Number
Variable Description:
A variable of the data type «Number» stores numerical values.
Default Value (on creation): 0
Example of Use:
Task: Create a variable of the «Number» type and specify it in the action parameter «Addition».
Solution:
Fill in the fields to create the variable.
Specify the created variable in the action parameters «Addition».