ui_drag
Drag a UI element from one position to another using AutomationId or screen coordinates, with configurable speed and modifier keys for .NET GUI automation.
Instructions
Drag from one position to another.
Two modes:
By AutomationId: from_automation_id + to_automation_id (uses cached rectangles)
By coordinates: from_x, from_y, to_x, to_y (absolute screen coords)
For mode 1, call ui_get_window_tree first to populate cache.
Args: from_automation_id: Source element AutomationId to_automation_id: Target element AutomationId from_x: Source X coordinate (screen absolute) from_y: Source Y coordinate to_x: Target X coordinate to_y: Target Y coordinate speed_ms: Total drag duration in milliseconds. Minimum 20 ms so the gesture always emits enough waypoints to cross common WPF drag thresholds reliably. hold_modifiers: Optional modifier names to hold for the full drag. Accepted values: ctrl, shift, alt, win.
Notes: - Identical from/to coordinates are rejected. - Short drags that stay below the system drag threshold should use ui_click instead of ui_drag.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from_automation_id | No | ||
| to_automation_id | No | ||
| from_x | No | ||
| from_y | No | ||
| to_x | No | ||
| to_y | No | ||
| speed_ms | No | ||
| hold_modifiers | No |