Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using Text for Commands
#1
Hi
I don't now how to do much of this. The last time I did any programing was 30 years ago with fortran. I have been doing simple copy and paste between 2 programs but I now have to read a letter, M or F for male or female, and get that to initiate a mouse click on the other program. The first program screen is DOS based. I can get the mouse clicks fine but it is interpeteing the letters that I can't seem to get. Here is how I approach it unsuccessfully so far:

//Get PatSex from screen and click the correct M or F
//if text is M then left click on M in "enter new patient demographics else if text is F click F
int w14=act(win("C332 - PCN-TERM - [91]192.168.0.50]" "Afx:400000:8:10011:0:*""" 0x800))
lef+ 400 331 w14
lef- 418 341 w14
id - 59648
lef 409 339 w14
if child(id("*" "static" "C332 - PCN-TERM - [91]192.168.0.50]" 1 409 339))= M
int w15=act(win("ENTER NEW PATIENT DEMOGRAPHICS" "ThunderRT6FormDC"))
lef+ 273 104 w15
lef- 274 104 w15
lef 134 87 w15
int w16=act(win("ENTER NEW PATIENT DEMOGRAPHICS" "ThunderRT6FormDC"))
lef 168 92 w16
else child(id("*" "static" "C332 - PCN-TERM - [91]192.168.0.50]" 1 409 339))= F
int w17=act(win("ENTER NEW PATIENT DEMOGRAPHICS" "ThunderRT6FormDC"))
lef 164 90 w17
#2
id - 59648 used incorrectly, don't know what you wanted to do.

if child(id("*" "static" "C332 - PCN-TERM - [91]192.168.0.50]" 1 409 339))= M
...
else child(id("*" "static" "C332 - PCN-TERM - [91]192.168.0.50]" 1 409 339))= F

used incorrectly. Use something like

Macro
Code:
Copy      Help
int w1=child("*" "static" ...)
str s.getwintext(w1)
if(s="M")
,...
else if(s="F")
,...
#3
That was helpful to know I can't do it that way. The screen where the text is coming from is a DOS program window and I can't really define the child or subscreen screen specific to the area I need, instead it takes the entire screen. I think the best way is to copy it onto the clipboard and then extract the text. Here is how I set that up but it still didn't work.

//Get PatSex from screen and click the correct M or F
//if text is M then left click on M in "enter new patient demographics else if text is F click F
int w14=act(win("C332 - PCN-TERM - [91]192.168.0.50]" "Afx:400000:8:10011:0:*""" 0x800))
lef+ 403 329 w14
lef- 413 340 w14
rig+ 411 338 w14
int w18=win("" "#32768")
rig- 0 0 w18
lef 32 14 w18
str s = "A"
int w15 getclip("A")
if("A"="M")
int w16=act(win("ENTER NEW PATIENT DEMOGRAPHICS" "ThunderRT6FormDC"))
lef 168 92 w16
else if("A"="F")
int w17=act(win("ENTER NEW PATIENT DEMOGRAPHICS" "ThunderRT6FormDC"))
lef 164 90 w17
#4
Try
Get console window text
#5
HI Gintaras
I tried the "viewtopic.php?p=9505" but wasn't sure what to do with it. When I plugged it in to Quick Macros, it said, "unknown identifier". Is there a way I can bring the Text from the clipboard in as a variable and then use the variable for what I want to do with it. Thanks Karl
#6
Clipboard to variable? It is in Text dialog, in floating toolbar. Also in QM Help.
#7
Hi Gintaras
The instructions were fine the problem was that the text had to be copied with a space in front of it and I didn't include the space in my wording. Works fine now. Thanks Karl


Forum Jump:


Users browsing this thread: 1 Guest(s)