Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dynamic Coordinates
#1
HI,

Below is a small utility code I run repeatedly.
Every time the code goes to the next line of the CRM, the coordinates of right and left click changes too.
How do I make these dynamic?
How can the program self-realize the current coordinates to click, after the down arrow is executed?

Macro Process Confirmation - Option Confirmation
Code:
Copy      Help
rep varRep
,int w1=act(win("Land Rover vehicle order import " "KCMLMasterForm_32"))
,'D; 0.75        ;; Down
,rig 705 362 w1 1; 0.75 ;;KCMLGridPad_32
,lef 78 13 wait(18 WV win("" "#32768")) 1; 2.54 ;;menu item 'View specification'
,;men 26694 id(514 w1) ;;View specification
,int w2=wait(15 win("Vehicle specification - XCO: M8621180" "KCMLMasterForm_32"))
,lef 960 144 w2 1 ;;push button 'Process'
,wait 1
,
Best Regards,
Philip
#2
If Down arrow selects an accessible object, you can get its coordinates.
Else if it changes text caret position, try function GetCaretXY.
Else if it changes pixel color, search for that color.
Else measure distances and use code like this:

int row rowHeight=20
for row 0 varRep
,...
,rig 302 row*rowHeight+362 ...
#3
Yes, upon down arrow, the right and left click code sequence should work, if the new record is pink.
It is not an accessible object.

How do I give a condition statement for checking colour?
Best Regards,
Philip
#4
Quote:How do I give a condition statement for checking colour?
Use dialog "Find image".
------------

Also try GetCaretXY.
#5
Yes, I got the below using that method.

How do I integrate that with the if condition on the above code?
I mean right & left click sequence should work, if colour is pink only.

Macro Process Confirmation - Option Confirmation
Code:
Copy      Help
,int w=win("Land Rover vehicle order import - " "KCMLMasterForm_32")
,scan "color:0xFF66FF" child("" "KCMLGridPad_32" w 0x0 "id=100" 2) 0 1|2|16
Best Regards,
Philip
#6
In dialog "Find image" uncheck "error if not found". Then it generates code with if.
#7
Got it.

Worked perfectly.

Thanks Gintaras.
Best Regards,
Philip


Forum Jump:


Users browsing this thread: 1 Guest(s)