but[+|-|*|%] hwndbutton
but[+|-|*|%] id|text window
int but(hwndbutton)
int but(id|text window)
hwndbutton - button handle. Integer. To get button handle, use function id or child.
window - top-level parent window. The function searches only in the first found matching window.
id - button id. Integer.
text - button label. String. Can be partial, but from beginning. Underlined characters must be preceded with &. Button class name must be "Button" or contain "Button" or "Btn".
Options: + check checkbox; - uncheck checkbox; * toggle checkbox; % click if unchecked; default: click.
Syntax1 and 2
Clicks, checks or unchecks button, check box or radio button. If window is inactive, this command does not always work, unless option character (+, - or *) is used. Option characters usually are used with check boxes, and should not be used with radio buttons. Option + also can be used with push buttons.
Syntax3 and 4
Returns check state of check box or radio (option) button. Return value: 0
- unchecked, 1 - checked, 2 indeterminate.
but child(100 100 "Calc") ;;click button at 100 100 of "Calc" window but id(306 "Calc") ;;click button with id=306 on window "Calc" but+ 306 "Calc" ;;check check-button with id=306 on window "Calc" but "&Open" "Open" ;;click button "Open" on window "Open" If radio button "Down" in "Find" dialog is unchecked, click it: int h=child("&Down" "Button" "Find") if(!but(h)) but h