type_text
Type text into a focused input field or specified UI element, optionally clearing existing content first. Falls back to keyboard injection when direct element input is unavailable.
Instructions
输入文本。若给 ref(文本框/输入区),优先用元素级 set_value(最稳,不受焦点影响);否则/失败时降级为键盘注入(xdotool type)。clear_first=true 先全选删除原内容再输入。建议:先 click(ref) 聚焦目标输入框,再 type_text。键盘注入会回报输入后的活动窗口标题——焦点被别的应用抢走时一眼可见,不必再截图核对。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | ||
| ref | No | ||
| text | Yes | ||
| clear_first | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |