Description
This activity is used when it is needed to simulate pressing a specific hotkey or a key combination. It can be useful when interacting with all of kinds of applications.
For example, it is possible to input some text into a file and then save it. This is how this feature makes interaction with applications much simpler. Otherwise, you would have to pick the 'Save' button in the application manually using Desktop Picker which is more time consuming.
In this example workflow we input text into a .txt file and then save it right after text input was complete
Desktop Picker
To be able to click an element of an app, we must start from defining the app element to use. This is handled by Desktop Picker.
In this example we pick the input field of Notepad++ application which was used in the example above.
To pick the desired element, open the dropdown menu in the Interface element parameter and then click the ‘Pick New Element’ button.
Here you can select an element or pick a new one
This will launch Desktop Picker. Open the desired app, hover your cursor over the required element (for example, text input field in Notepad). It will be highlighted red. Then press Ctrl + X to pick this element.
As soon as the element is picked, this window will appear. It indicates that the element was found and recognized. You can also set the element name here. It will be displayed in Studio Pro.
Advanced options menu displays the structure, or the selector of the indicated element. It usually consists of multiple tabs and each tab has its own attributes and values which represent the hierarchy of how the interface element is developed. You can modif, check or uncheck the attributes to achieve better accuracy or stability of interaction with the element.
Advanced options menu
The ‘Test’ button lets you check if the element was defined correctly. Upon clicking it, focus will be shifted to the browser window and the picked element will be highlighted yellow if it was recognized correctly. It can display one of the following messages:
- Found 1 element means that the specific element was successfully recognized.
- Found >1 element means that there are a few similar elements. In this case it is required to pick one of them or double check the advanced options.
- Not found means that the element was not recognized and must be redefined or the advanced options must be corrected.
The ‘Replace element’ button lets you pick another element.
Click ‘Save’ once you are ready. This element will be saved for further usage in Studio Pro activities.
Once the setup is done, you should see this in the Interface element parameter. There is a preview image of the picked element.
Preview of the selected element
Alternatively, the Use focused element checkbox lets you use the element in your currently opened app. For example, you have opened one more Notepad file and you are currently editing it (this means that your cursor is placed somewhere in its text input field). In this case you may skip choosing the specific element as described above. Your text will be typed into the focused app.
It is also possible to edit an existing element that you have previously picked. To do this, click the ‘Edit element’ button below its name.
Here you can edit the element or pick a new one
This is what you will see. Here you can change its name or replace the element completely by picking a new one.
Element properties and the button that lets you replace it
If you choose to replace the element by clicking the ‘Change the element button’, Picker will be activated again. Once you pick the new element, this window will appear. It shows the old and new versions and lets you either save it and overwrite the old element or cancel the replacement.
Here you can choose the new element version
An important note about elements names: when working with text editors such as Notepad or others, the file name is usually changed after the file was modified. Often an asterisk symbol (*) is added to its name. For example, if the file name is new1.txt, then after modifying it will become *new1.txt. Basically, it means that one of the selector attributes was changed, and the element will not be recognized even it is still the same input field. To prevent trouble caused by it, it is advised to uncheck the Name attribute or pick the element once again as shown above and select the Improved option. In most of the cases this will combine the properties of the old and the new element and make the selector work correctly.
Parameters
The first parameter of this activity is Interface element. It defines the element that will be used here. The process of picking an element was described in the previous section.
Next, there are Use focused element and Click on element first checkboxes. The former was also described in Desktop Picker section above. The latter is self-explanatory.
Use focused element and Click on element first options checkboxes
Then there is the core part of the activity: Key Modifiers and Key parameters. It defines what key or key combination will be used.
Key Modifiers parameter is used to simulate holding a specific key. Ctrl, Alt, Shift and Win keys are available. Check as many as required.
Here we use Ctrl + S key combination to save the file
Also note that the only English letters must be used as hotkeys. The system keyboard layout must also be switched to English while the bot is being executed.
Wait before, sec and Wait after,sec parameters indicate how much time will pass before or after executing this activity.
Wait before, sec and Wait after,sec parameters