10-21-2010, 01:18 AM
Hello,
This is my first post, even though I've been using QM for several months now.
I'm trying to get a some text from program X, open a new file on program Y, then write the text from program X onto Y. Seems very simple, the problem is I can't figure out how to get the macro to wait the right amount of time for program Y to receive the text. Here's the macro:
str empt.getclip ;;epmty clipboard
act win("Centricity EMR" "Transparent Windows Client")
key Cc ;;copy selection
str s
s.getclip
int i=mac("Blank Report")
wait 0 H i ;;wait until report ready
act(win("SpeechQ Report Station - [Attending Recording]" "WindowsForms10.Window.8.app11"))
key (s)
Blank report is another dummy macro that gets a new blank report ready in program Y:
int w3=act(win("SpeechQ Report Station" ))
lef 50 284 w3
int w4=wait(5 win("New Report"))
lef 378 105 w4
lef 608 99 w4
int w5=win("" "ComboLBox")
lef+ 442 34 w5
lef- 439 93 w5
lef 214 97 w5
act w4
lef+ 389 230 w4
lef- 390 230 w4
I keep getting a "window not found" error at the line act(win("SpeechQ Report Station - [Attending Recording]" "WindowsForms10.Window.8.app11")). I think it's because Blank report is not done running by the time I go try to activate the window, even though I thought waiting for the synchronization handle would take care of the problem. That said, I can't come up with a workaround.
If I add the line:
int i=mac("Blank Report")
wait 0 H i ;;wait until report ready
wait 0 WC "SpeechQ Report Station - [Attending Recording]"
act(win("SpeechQ Report Station - [Attending Recording]" "WindowsForms10.Window.8.app11"))
the macro "hangs", i.e. waits indefinetely.
If I add the line:
int i=mac("Blank Report")
wait 0 H i ;;wait until report ready
5
act(win("SpeechQ Report Station - [Attending Recording]" "WindowsForms10.Window.8.app11"))
It waits 5 seconds, then runs Blank Report, then gives me the "window not found" error. That one I'm really confused about, it looks like the two threads are running independently. I've also tried running Blank Report without waiting for the synchronization handle, and it also didn't help.
Any help would be greatly appreciated. And please forgive my ignorance.
Diego Covarrubias
[email protected]
This is my first post, even though I've been using QM for several months now.
I'm trying to get a some text from program X, open a new file on program Y, then write the text from program X onto Y. Seems very simple, the problem is I can't figure out how to get the macro to wait the right amount of time for program Y to receive the text. Here's the macro:
str empt.getclip ;;epmty clipboard
act win("Centricity EMR" "Transparent Windows Client")
key Cc ;;copy selection
str s
s.getclip
int i=mac("Blank Report")
wait 0 H i ;;wait until report ready
act(win("SpeechQ Report Station - [Attending Recording]" "WindowsForms10.Window.8.app11"))
key (s)
Blank report is another dummy macro that gets a new blank report ready in program Y:
int w3=act(win("SpeechQ Report Station" ))
lef 50 284 w3
int w4=wait(5 win("New Report"))
lef 378 105 w4
lef 608 99 w4
int w5=win("" "ComboLBox")
lef+ 442 34 w5
lef- 439 93 w5
lef 214 97 w5
act w4
lef+ 389 230 w4
lef- 390 230 w4
I keep getting a "window not found" error at the line act(win("SpeechQ Report Station - [Attending Recording]" "WindowsForms10.Window.8.app11")). I think it's because Blank report is not done running by the time I go try to activate the window, even though I thought waiting for the synchronization handle would take care of the problem. That said, I can't come up with a workaround.
If I add the line:
int i=mac("Blank Report")
wait 0 H i ;;wait until report ready
wait 0 WC "SpeechQ Report Station - [Attending Recording]"
act(win("SpeechQ Report Station - [Attending Recording]" "WindowsForms10.Window.8.app11"))
the macro "hangs", i.e. waits indefinetely.
If I add the line:
int i=mac("Blank Report")
wait 0 H i ;;wait until report ready
5
act(win("SpeechQ Report Station - [Attending Recording]" "WindowsForms10.Window.8.app11"))
It waits 5 seconds, then runs Blank Report, then gives me the "window not found" error. That one I'm really confused about, it looks like the two threads are running independently. I've also tried running Blank Report without waiting for the synchronization handle, and it also didn't help.
Any help would be greatly appreciated. And please forgive my ignorance.
Diego Covarrubias
[email protected]