Interactions and Tools
Learn how to interact with UI elements using AskUI’s powerful tools and actions
Interacting with UI Elements
Once you’ve selected an element, you can interact with it using AskUI’s comprehensive set of actions and tools. This guide covers the different ways to interact with elements, from basic clicks to complex keyboard operations.
Basic Actions
The most common actions for interacting with elements:
Keyboard Operations
Control keyboard input for complex interactions:
Supported Keyboard Keys
Modifier Keys
alt
,control
,shift
,command
left_control
,right_control
left_alt
,right_alt
left_shift
,right_shift
Navigation Keys
- Arrow keys:
up
,down
,left
,right
home
,end
,pageup
,pagedown
tab
,enter
,escape
Function Keys
f1
throughf24
(exceptf10
)
Media Keys
audio_mute
,audio_vol_up
,audio_vol_down
audio_play
,audio_stop
,audio_next
,audio_prev
Built-in Tools
AskUI provides several built-in tools for different types of interactions:
OS Tools
Control operating system-level operations:
Web Browser Tools
Control web browser operations:
Clipboard Tools
Manage clipboard operations:
Information Extraction
Use the get()
method to extract information from the screen:
Best Practices
- Action Selection
- Use the simplest action that accomplishes your goal
- Consider element state before interacting
- Handle potential errors gracefully
- Keyboard Operations
- Use modifier keys for shortcuts
- Release keys after use
- Use appropriate key combinations
- Tool Usage
- Choose the appropriate tool for the task
- Combine tools when needed
- Follow tool-specific best practices
- Information Extraction
- Use response schemas for structured data
- Be specific in your queries
- Handle potential errors
By following these guidelines and using the appropriate actions and tools, you can create robust and reliable automation workflows with AskUI.