I am using UiPath Studio 2019 community version. Today we will explore a ready-to use-template called "Triggered Based Automation", as the template name suggests, it triggers as an automation in response to a mouse or keyboard user event.
Select trigger based attended automation and create it by assigning a name.
After creation, it will look like below,
As you can see we have 3 trigger activities,
And then we have “Event Handler”. It will be executed once one of the 3 activities gets triggered.
Click Trigger
This activity monitors click events. After a click on the selected area on the screen, this activity gets triggered. We can use this activity inside the “Monitor Events” activity.
Here are the properties for this activity,
When we select a particular UI element on screen using “Indicate element on screen” option on-click trigger, then in the “selector” property we will get an XML representation as string.
Ex. If I click on “File” menu of Microsoft Word document then it’s selector will be like,
"<wnd app='winword.exe' cls='OpusApp' title='New Microsoft Word Document - Microsoft Word (Product Activation*' />
<uia cls='MsoCommandBar' name='Ribbon' />
<uia automationid='FileTabButton' cls='NetUIRibbonTab' name='File Tab' />"
Key Press trigger
This activity gets triggered when a particular keyboard key is pressed on a specified UI element. Like the Click trigger, we can use this activity inside “Monitor Events” activity only.
As in the click trigger activity, selector is the same way; we have to select selector for this activity.
We will take a previous example of MS Word. Suppose now you want to open a new word document after clicking on blank space and using shortcut key “Alt+N”. Then your activity will be like this,
HotKey Trigger
This activity monitors a specified system-wide key event. Whenever these key combos are pressed onscreen then it gets triggered.
To check if it is working or not I have taken a message box like below in event handler
After executing and performing a particular click or key press we will see the below message box
Note
In this built-in template they have given us 3 triggers by default but it not necessary to use all three every time, we can use any one as per our requirement.
There are additional triggers also, all these triggers come under “User Events” category in activity panel,
Summary
Today we learned about UiPath studio’s ready-to-use trigger based automation template. Using this template we can trigger multiple actions on screen.