Posts: 7
Threads: 1
Joined: Feb 2016
I am now using Quick Macros to do the same operation in a series of windows. Wait for window XXX finish, the time XXX running is about 2 hours, then goes to the next window by minimizing current window. But it doesn't perform stable, sometimes works sometimes just does not execute "minimize". Where should I revise and is there any better solution for my tasks?
Many thanks for helping.
BTW, I would like to buy the software if it can help me in this tasks. I just trial it.
my code is like follows:
spe 500
int i
for i 0 10
....
wait 0 -WC "XXX"
#region Recorded 2/21/2016 2:16:00 PM
clo win("Optimization Report");err
clo win("Format Objects");err
min win()
Posts: 12,071
Threads: 140
Joined: Dec 2002
Macro
Macro2693
ARRAY(int) a; win "XXX" "YYY" "ZZZ" 0 "" a ;;get handles of all XXX windows
spe 500
int i
for i 0 a.len
,act a[i] ;;activate an XXX window
,;...
,wait 0 -WC "XXX"
,#region Recorded 2/21/2016 2:16:00 PM
,clo win("Optimization Report");err
,clo win("Format Objects");err
Posts: 7
Threads: 1
Joined: Feb 2016
Thanks a lot, Gintaras.
But one issue is that since there are too many files' names, I cannot type them one by one, is there a way to get handles of all Windows which I opened (I will close all the other windows but them)?
Posts: 12,071
Threads: 140
Joined: Dec 2002
can be
win "part of window name without file name" "YYY" "ZZZ" 0 "" a
or
win "" "YYY" "ZZZ" 0 "" a ;;no window name, just class and/or program
To get ALL windows, better use GetMainWindows a, because win ... would also get taskbar, desktop and maybe some other unwanted windows.
Macro for testing what window gets GetMainWindows or win:
Macro
Macro2696
out
ARRAY(int) a
GetMainWindows a ;;this should get only windows that have taskbar button
;win "" "" "" 0 "" a ;;this would get several other windows too
int i
for i 0 a.len
,outw a[i]
Posts: 7
Threads: 1
Joined: Feb 2016
It works well. Thank you, Gintaras.
Posts: 7
Threads: 1
Joined: Feb 2016
Hi Gintaras,
This morning I found my code doesn't work proper. But before, when I did some small test, it worked well. May it because I use them on Virtual Machines?
The error is: cannot activate window.
I use the second way you show me:
ARRAY(int) a; win "" "ATL_MCMDIMainFrame" "" 0 "" a
spe 500
int i
for i 0 a.len
act a[i]
;;recorded macro
wait 0 -WC "Optimization Progress"
;;I delect the close command since no need to "minimize"
Posts: 7
Threads: 1
Joined: Feb 2016
I attach my Recorded Macro as well. Thanks you.
#region Recorded 2/22/2016 10:41:16 AM
int w1=act(win())
lef 127 15 w1 1 ;;tool bar, menu item 'Insert'
lef 64 81 wait(15 WV win("" "#32768")) 1 ;;menu item 'Signal...'
men 3067 child("" "MC_MDICommandBar" w1) ;;Signal...
int w2=wait(15 win("Insert Study" "#32770"))
lef+ 398 85 w2 1 ;;list, indicator 'Position'
mou ":A@A@AB@F@L@HAK@L@K@L@E@N@L@L@N@J@M@I@HaH@EaH@G@N@H@I@HaG@DaFaEaGaG@E@D@G@C@C@B@B@B@B@A@B@B@B@A@B@A@A@AAA"
lef- 396 403 w2 1
lef 227 390 w2 1 ;;list, list item 'zcsFW5-13_IT6_ADPR2'
lef 285 470 w2 1 ;;push button 'OK'
int w3=wait(22 win("Format Objects" "#32770"))
lef 583 223 w3 1 ;;push button 'Optimize...'
int w4=wait(15 win("Select Optimization Method" "#32770"))
lef 251 208 w4 1 ;;push button 'OK'
int w5=wait(15 win("Exhaustive Search Properties" "#32770"))
lef 371 83 w5 1 ;;list
'"1" DDDY ;; "1" Down Down Down Enter
'D(#6)R ;; Down(*6) Right
lef 427 174 w5 1 ;;list
'"2" DY ;; "2" Down Enter
'D(#15) ;; Down(*15)
lef 428 243 w5 1 ;;list
'"9" Y ;; "9" Enter
'D(#5) ;; Down(*5)
lef 427 244 w5 1 ;;list
'"8" ;; "8"
lef 503 242 w5 1 ;;list
'"2" ;; "2"
lef 481 245 w5 1 ;;editable text
'Y ;; Enter
'D(#11) ;; Down(*11)
lef 343 225 w5 1 ;;list
'"13" ;; "13"
lef 451 225 w5 1 ;;list
'"23" ;; "23"
lef 514 228 w5 1 ;;list
'"2" ;; "2"
lef 457 288 w5 1 ;;dialog
lef 517 317 w5 1 ;;push button 'OK'
#endregion
Posts: 7
Threads: 1
Joined: Feb 2016
When I keep the monitor of Virtual Machines opened, it can work. Should I always have to keep them on? Because my Recorded Macro is a series of mouse movements.
Posts: 7
Threads: 1
Joined: Feb 2016
The problem is solved, thanks Gintaras.