Posts: 109
Threads: 45
Joined: Mar 2007
I have a macro that requires clicking in the right spot b/c there are no kb shortcuts (tabbing, etc).
But the size of the window and the column widths within it can change the position of a check box to just about anywhere.
How could I have a macro go:
int intX
int intY
Msg box "Dear user, please click check box"
capture coordinates to intX, intY
use intX, intY to check off box later in macro
Posts: 1,769
Threads: 410
Joined: Feb 2003
try using "accessible objects actions" or "control specific actions".
usually you can click and drag the target reticle over the checkbox and have it set the state.
Posts: 12,147
Threads: 143
Joined: Dec 2002
Or, it is is not possible, for example in java programs, try Find Image.
To capture mouse coordinates can be used xm or GetCursorPos:
OnScreenDisplay "Dear user, please click check box" 3
wait 0 ML
POINT p
xm p ;;capture coordinates to p
;...
lef p.x p.y ;;use p to check off box later in macro
Posts: 109
Threads: 45
Joined: Mar 2007
Thanks Ken
I went with your code there Gintara, works great
2 questions
1-Can OnScreenDisplay message disappear upon clicking anywhere (on check box) instead of on the display text to get rid of it. I'd like to pace this (I have a few clicks to record) by when the user clicks, not by set time between click requests.
2-Where can I find help on POINT function?
Thanks Gintara!
Posts: 1,769
Threads: 410
Joined: Feb 2003
OnScreenDisplay can be "click hide" set the flag for it though.
OnScreenDisplay("Click Here" 2 1 10 "" 18 0x2a2a2a 4)
look in help for "xm" topic in the help for POINT.
Posts: 12,147
Threads: 143
Joined: Dec 2002
OnScreenDisplay "Dear user, please click check box" 30
wait 0 ML
clo win("" "QM_OSD_Class"); err
...
POINT is a variable type. It consists of two int variables - x and y. Function xm populates a variable of POINT type with mouse coordinates.
Posts: 109
Threads: 45
Joined: Mar 2007
Thanks.
I used your code and had played with flags before.
You have to click the message to get rid of it.
Can the user click the checkbox and have the message disappear at that point?