- Overview
- UI Automation
- UI-ANA-016 - Pull Open Browser URL
- UI-ANA-017 - ContinueOnError True
- UI-ANA-018 - List OCR/Image Activities
- UI-DBP-006 - Container Usage
- UI-DBP-013 - Excel Automation Misuse
- UI-DBP-030 - Forbidden Variables Usage In Selectors
- ST-DBP-021 - Hardcoded Timeout
- UI-PRR-001 - Simulate Click
- UI-PRR-002 - Simulate Type
- UI-PRR-003 - Open Application Misuse
- UI-PRR-004 - Hardcoded Delays
- UI-REL-001 - Large Idx in Selectors
- UI-SEC-004 - Selector Email Data
- UI-SEC-010 - App/Url Restrictions
- UI-USG-011 - Non Allowed Attributes
- SY-USG-013 - Private File Invoke
- SY-USG-014 - Incorrect Execution Template Placeholders
- Applications and technologies automated with UI Automation
- UiPath Browser Migration Tool
- Computer Vision Recorder
- Click
- Hover
- Type Secure Text
- Send Hotkey
- Type Into
- Check
- Select Item
- Select Multiple Items
- Get Text
- Set Text
- Activate
- Highlight
- Set Focus
- Anchor Base
- Context Aware Anchor
- Find Relative Element
- Indicate On Screen
- Element Exists
- Find Element
- Wait Element Vanish
- Find Children
- Get Ancestor
- Element Scope
- Get Attribute
- Set Clipping Region
- Get Position
- Take Screenshot
- Wait Attribute
- On Element Appear
- On Element Vanish
- Click Text
- Hover Text
- Find Text Position
- Get Full Text
- Get Visible Text
- Extract Structured Data
- Text Exists
- Click OCR Text
- Hover OCR Text
- Get OCR Text
- Find OCR Text Position
- Microsoft OCR
- Microsoft Project Oxford Online OCR
- Microsoft Azure Computer Vision OCR
- Tesseract OCR
- Google Cloud Vision OCR
- OCR Text Exists
- Click Image
- Hover Image
- Find Image Matches
- Image Exists
- Find Image
- Wait Image Vanish
- On Image Appear
- On Image Vanish
- Load Image
- Save Image
- Attach Browser
- Close Tab
- Go Back
- Go Forward
- Go Home
- Inject JS Script
- Navigate To
- Open Browser
- Refresh Browser
- Set Web Attribute
- Attach Window
- Close Window
- Get Active Window
- Hide Window
- Maximize Window
- Minimize Window
- Move Window
- Restore Window
- Show Window
- Export UI Tree
- Invoke ActiveX Method
- Inject .NET Code
- Click Trigger
- Key Press Trigger
- Click Image Trigger
- System Trigger
- Hotkey Trigger
- Mouse Trigger
- Get Event Info
- Monitor Events
- Get Source Element
- Replay User Event
- Block User Input
- Use Foreground
- Element Attribute Change Trigger
- Element State Change Trigger
- Callout
- Copy Selected Text
- Get From Clipboard
- Set To Clipboard
- Close Application
- Open Application
- Start Process
- Get Password
- Tooltip
- Click Picture on Screen
- Click Toolbar Button
- Read Statusbar
- Select Dates in Calendar
- Select Menu Item
- Expand Tree
- Call Transaction
- SAP Logon
- SAP Login
- Table Cell Scope
- SAP Session Attributes Change Trigger
- Expand ALV Tree
- Expand ALV Hierarchical Table
- Use Application/Browser
- Check App State
- Check/Uncheck
- Click
- Extract Table Data
- Get Text
- Get URL
- Go to URL
- Highlight
- Hover
- Keyboard Shortcuts
- Navigate Browser
- Select Item
- Take Screenshot
- Type Into
- Get Attribute
- Get Browser Data
- Set Browser Data
- Mouse Scroll
- Inject Js Script
- Drag and Drop
- For Each UI Element
- Application Event Trigger
- Click Event Trigger
- Keypress Event Trigger
- Set Text
- Check Element
- Fill Form
- Perform browser search and retrieve results using UI Automation APIs
- Web Browsing
- Find Images
- Click Images
- Trigger and Monitor Events
- Create and Override Files
- HTML Pages: Extract and Manipulate Information
- Window Manipulation
- Automated List Selection
- Find and Manipulate Window Elements
- Manage Text Automation
- Load and Process Images
- Manage Mouse Activated Actions
- Automate Application Runtime
- Automated Run of a Local Application
- Browser Navigation
- Web Automation
- Trigger Scope Example
- Computer Vision Local Server
- Mobile Automation
- Release notes
- Project compatibility
- Get Log Types
- Get Logs
- Get Page Source
- Get Device Orientation
- Get Session Identifier
- Install App
- Manage Current App
- Manage Other App
- Open DeepLink
- Open URL
- Mobile Device Connection
- Positional Swipe
- Press Hardware Button
- Set Device Orientation
- Take Screenshot
- Take Screenshot Part
- Element Exists
- Execute Command
- Get Attribute
- Get Selected Item
- Get Text
- Set Selected Item
- Set Text
- Swipe
- Tap
- Type Text
- Draw Pattern
- Terminal
Trigger and Monitor Events
The example below explains how to monitor user events and trigger different actions by using different hotkeys for opening certain applications. For example, the user can use a hotkey combination for opening the Calculator app from Windows.
It presents activities such as Hotkey Trigger, Monitor Events, or Get Event Info. You can find these activities in the UiPath.UIAutomation.Activities package.
This is how the automation process can be built:
- Open Studio and create a new Process named by default Main.
- Drag a Sequence container in the Workflow Designer.
-
Create the following variable:
Variable Name
Variable Type
Default Value
ContinueMonitor
Boolean
 -
Drag a Log Message activity inside the Sequence container.
- In the Properties panel, select the Level option from the Message drop-down list.
- Add the expression
"Start monitoring..."
in the Message field.
-
Add an Assign activity under the Log Message activity.
- In the Properties
panel, add the variable
ContinueMonitor
in the To field. - Add the condition
True
in the Value field.
- In the Properties
panel, add the variable
-
Place a Monitor Events activity below the Assign activity.
- In the Properties
panel, add the value
ContinueMonitor
in the RepeatForever field.
- In the Properties
panel, add the value
-
Drag a Hotkey Trigger activity inside the Monitor Events activity. This activity opens the Calculator app from Windows.
- Select the checkboxes for the
Alt
andShift
options. - In the
Key
field, type the letterc
. - In the Properties panel, select the option EVENT_BLOCK from the EventMode drop-down list.
- Select the checkboxes for the
-
Drag another Hotkey Trigger activity and place it next to the previous Hotkey Trigger activity. This activity opens a new browser tab and searches on Google the text previously selected by the user.
- Select the checkboxes for the Alt and Shift options.
- In the Key field, type
the letter
g
. - In the Properties panel, select the option EVENT_BLOCK from the EventMode drop-down list.
-
Drag another Hotkey Trigger activity and place it next to the previous Hotkey Trigger activity. This activity stops monitoring the events.
- Select the check boxes for the Alt and Shift options.
- In the Key field, type
the letter
s
. - In the Properties panel, select the option EVENT_BLOCK from the EventMode drop-down list.
-
Add a new Sequence container and place it below the Hotkey Trigger activity.
- In the Properties
panel, add the name
Event Handler
in the DisplayName field. -
Create the following variable:
Variable Name
Variable Type
Default Value
TriggerHotkey
UiPath.Core.EventInfo
 ContinueMonitor
Boolean
Â
- In the Properties
panel, add the name
-
Drag a Log Message activity inside the Event Handler.
- In the Properties panel, select the Info option from the Level drop-down list.
- Add the expression
"Event triggered"
in the Message field.
-
Drag a Get Event Info activity below the Log Message activity.
- In the Properties
panel, add the variable
TriggerHotkey
in the Result field. - Select the UiPath.Core.EventInfo option from the TypeArgument drop-down list.
- In the Properties
panel, add the variable
-
Place a Switch activity below the Get Event Info activity. All Hotkey Triggers are described inside this activity and treated as cases.
- In the Properties
panel, add the value
TriggerHotkey.KeyEventInfo.KeyName.ToLower
in the Expression field. - Select the String option from the TypeArgument drop-down list.
- In the Properties
panel, add the value
-
Click the Add new case button from the Switch activity.
- Add the value
c
in the Case value field.
- Add the value
-
Place an Open Application activity and place it inside the Case c container. This represents the first Hotkey Trigger case that opens the Calculator app.
- In the Properties
panel, add the expression
"calc.exe"
in the Arguments field. - Add the expression
"<wnd app='applicationframehost.exe' title='Calculator' />"
in the Selector field.
- In the Properties
panel, add the expression
-
Click the Add new case button from the Switch activity.
- Add the value
g
in the Case value field.
- Add the value
-
Drag a Sequence container and place it inside the Case g container. This represents the second Hotkey Trigger case that initiates a Google search for the previously selected text.
- In the Properties
panel, add the name
Google selected text
in the DisplayName field. -
Create the following variable:
Variable Name
Variable Type
Default Value
TextToSearch
GenericValue
Â
- In the Properties
panel, add the name
-
Drag a Delay activity and place it inside the Google selected text sequence.
- In the Properties
panel, add the value
00:00:00.5000000
in the Duration field.
- In the Properties
panel, add the value
-
Add a Copy Selected Text activity below the Delay activity.
- In the Properties
panel, add the value
True
in the ContinueOnError field. - Add the variable
TextToSearch
in the Result field. - Add the value
2000
in the Timeout (milliseconds) field.
- In the Properties
panel, add the value
-
Drag an If activity under the Copy Selected Text activity.
- In the Properties
panel, add the expression
TextToSearch IsNot Nothing
in the Condition field.
- In the Properties
panel, add the expression
-
Place an Open Browser activity inside the Then box.
- In the Properties panel, select the IE option from the BrowserType drop-down list.
- Add the expression
"www.google.com"
in the Url field. - Select the checkbox for the NewSession option. This starts a new session in the selected browser.
-
Place a Type Into activity inside the Do sequence.
- In the Properties panel, select the Target option from the Target drop-down list.
- Add the expression
"<webctrl tag='INPUT' aaname='Search' />"
in the Selector field. - Select the INTERACTIVE option from the WaitForReady drop-down list.
- Add the variable
TextToSearch
in the Text field. - Select the checkbox for the Activate option. This option brings the UI element to the foreground and activates it before the text is written.
- Select the checkbox for the SimulateType option. This option simulates the type using the technology of the target application.
-
Drag a Send Hotkey application below the Type Into activity.
- In the Properties
panel, add the expression
"enter"
in the Key field. - Select the Target option from the Target drop-down list.
- Add the expression
"<webctrl tag='INPUT' aaname='Search' />"
in the Selector field. - Select the INTERACTIVE option from the WaitForReady drop-down list.
- Select the checkbox for the Activate option. This option brings the UI element to the foreground and activates it before the text is written.
- Select the None option from the KeyModifiers drop-down list.
- Select the checkbox for the SpecialKey option. This option indicates if the use of a special key in the keyboard shorcut.
- In the Properties
panel, add the expression
-
Drag a Message Box activity in the Else container.
- In the Properties panel, select the Ok button from the Buttons drop-down list.
- Add the expression
"Text could not be copied. Please try again."
in the Text field. - Select the checkbox for the TopMost option. This option always brings the message box to the foreground.
-
Click the Add new case button from the Switch activity.
- Add the value
s
in the Case value field.
- Add the value
-
Drag an Assign activity inside the Case s container. This represents the third Hotkey Trigger case that stops monitoring the events.
- Add the variable
ContinueMonitor
in the To field. - Add the condition
False
in the Value field.
- Add the variable
-
Place a Log Message activity below the Monitor Events activity.
- In the Properties panel, select the Info option from the Level drop-down field.
- Add the expression
"Stop monitoring.."
in the Message field. -
This is how the workflow should look:
- Run the process. The robot activates the Hotkey Triggers and you can use any of the set key shortcuts.