Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need some Help
#1
Hi so ive been working on a macro that can clear a windows screen after 60 seconds

the code i came up with was
Code:
Copy      Help
int hwnd=val(_command)
opt err 1
wait 30
int wMain=win("Process Order" "WindowsForms10.Window.8.app.0.2780b98")
int w=child("" "*.Window.*" wMain 0x0 "wfName=bubbleBar5") ;; 'RadControl'
RECT r; SetRect &r 635 6 952 26
WindowText wt.Init(w r)
wt.Mouse(1 wt.Find("Exit"))
// checks tab and clears order id//
int wMain4=win("Dispatch Console" "WindowsForms10.Window.8.app.0.2780b98")
w=child("" "*.Window.*" wMain4 0x0 "wfName=tab_tabs") ;; 'RadControl'
SetRect &r 41 7 101 22
wt.Init(w r)
wt.Mouse(1 wt.Find("By Order Id"))
lef
int wMain5=win("Dispatch Console" "WindowsForms10.Window.8.app.0.2780b98")
w=child("" "*.Window.*" wMain5 0x0 "wfName=tab_tabs") ;; 'RadControl'
SetRect &r 42 8 102 20
wt.Init(w r)
wt.Mouse(0 wt.Find("By Order Id" 0x1))
lef
//clears out the order id //
int w3=win("Dispatch Console" "WindowsForms10.Window.8.app.0.2780b98")
lef 241 52 w3 1 ;;editable text
'Ca             ;; CTRL+A
'X              ;; DELETE
Speak "the scanner has been reset please try again"
shutdown -7

but the problem is i only want this to trigger after 60 seconds as i have worte it about it waits 60 seconds and then runs the process regardless of if the trigger is still active.

the logic i need to some how apply is;

if window is open longer than 60 seconds execute actions

can any one help me?
#2
or is there any way that the macro can query whether a function has run through its whole process?

for example;

function clicks a set of 6 buttons (final button exits the screen)
(some times the function completes but doesnt exit due to drop in internet)

perfect result would be for the script i wrote above to kick in if the other function has completed
#3
To simply tell if another qm function is still running use
IsThreadRunning

example taken from qm help
Function Function2
Code:
Copy      Help
mac "FunctionX" ;;run function "FunctionX" in separate thread
wait 5
if(IsThreadRunning("FunctionX"))
,out "FunctionX is running"
#4
you could also call the function to run after the other function has finished
using mac
do you want the code you wrote to run every time the other function finishes or only if it doesn't exit the window?
depending on what you need done will effect code needed
#5
ok well i can use this

so my one macro when it starts will launch the macro to clear the screen

now my issue is i needs it to keep checking if a window x is there and if the time that the window x is open is greater than 30 seconds to then run the part of the macro x i have already recorded
#6
example
Macro Macro2217
Code:
Copy      Help
int w=win("Untitled - Notepad" "Notepad")
wait(30 -WC w)
err ;;handle error, it is probably timeout
,mes "the window still exists after 30 s"
To create code for wait, in dialog "Wait" select "wait for window created" and check "Not" (it means "wait until destroyed").


Forum Jump:


Users browsing this thread: 1 Guest(s)