Problems with Wait for Window

Discuss RoboTask here
Post Reply
verona
Posts: 24
Joined: Wed Jun 25, 2008 4:16 pm

Problems with Wait for Window

Post by verona »

I seem to have run across a corner case where Wait for Window/Check for Window/{Window Exists()} doesn't work. I have two tasks- Scratch and Scratch2. Scratch executes an internal Basic script and then launches Scratch2. Scratch2 then executes a Wait for Window. But the task never proceeds, no matter how many times the window appears. If I either uncheck the Basic script in Scratch or just launch Scratch2 directly, the Wait for Window works without any problems. If I try to use and If/Then statement with {WindowExists()} then RoboTask stops responsing and I have to restart the whole program.
I'm using 3.2.1 with both patches applied on Windows Vista 32-bit. I've copied Scratch and Scratch2 using Notepad for the Wait for Window below for reference.
Please help with this- it is a showstopper.
;*****************************
;* RoboTask Task file        
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1221978872
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task4"
Hide=INTEGER|0
ID=INTEGER|1109131958
Name=STRING|"Scratch"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
[Actions\Action1]
ActionID=STRING|"BASIC_SCRIPT"
Enabled=INTEGER|-1
Name=STRING|"Internal basic script"
Params=FOLDER
[Actions\Action1\Params]
line00000=STRING|"Sub Main"
line00003=STRING|"End Sub"
linecount=STRING|"4"
source=STRING|"0"
[Actions\Action2]
ActionID=STRING|"A_TASKS_START"
Enabled=INTEGER|-1
Name=STRING|"Start Task ""Scratch2"""
Params=FOLDER
[Actions\Action2\Params]
taskid=STRING|"677512167"
wait=STRING|"1"
;*****************************
;* RoboTask Task file        
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1221978872
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task7"
Hide=INTEGER|0
ID=INTEGER|677512167
Name=STRING|"Scratch2"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
[Actions\Action1]
ActionID=STRING|"A_WAIT_FOR_WINDOW"
Enabled=INTEGER|-1
Name=STRING|"Wait For Window"
Params=FOLDER
[Actions\Action1\Params]
assignvariable=STRING|"0"
child=STRING|"0"
classexact=STRING|"0"
exact=STRING|"0"
hidden=STRING|"0"
infinity=STRING|"0"
timeout=STRING|"10"
usecaption=STRING|"1"
useclass=STRING|"0"
watchfor=STRING|"1"
wincaption=STRING|"Untitled - Notepad"
[Actions\Action2]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|0
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action2\Params]
case=STRING|"0"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{WindowExists(Untitled - Notepad)}"
[Actions\Action3]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|0
Name=STRING|"Show ""WindowExists worked"""
Params=FOLDER
[Actions\Action3\Params]
icon=STRING|"1"
msg0=STRING|"WindowExists worked"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action4]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|0
Name=STRING|"End If"
 
Oleg
Site Admin
Posts: 3137
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Problems with Wait for Window

Post by Oleg »

Thank you for your report. We investigate the problem.
verona
Posts: 24
Joined: Wed Jun 25, 2008 4:16 pm

Problems with Wait for Window

Post by verona »

Thanks, I greatly appreciate it!
verona
Posts: 24
Joined: Wed Jun 25, 2008 4:16 pm

Problems with Wait for Window

Post by verona »

One thing that I noticed today is that if I kill the
first task ("Scratch") after the second task has been
called, the second task ("Scratch2") continues on as if
it had just been paused the whole time.

Not sure if that's any help in debugging, but I thought
it was pretty interesting.
Oleg
Site Admin
Posts: 3137
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Problems with Wait for Window

Post by Oleg »

There is some problem of basic plugin. We keep trying to solve the problem.
Killing the task won't help you.

Now I recommend to move basic script into separated task:

Sctatch task:
start BasicTask and wait
start Scratch2 task and wait

This is working, we tested this.
verona
Posts: 24
Joined: Wed Jun 25, 2008 4:16 pm

Problems with Wait for Window

Post by verona »

I will give this a try. Thanks!
Oleg
Site Admin
Posts: 3137
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Problems with Wait for Window

Post by Oleg »

You have found very interesting effect. We have reorganized basic plugin at all. You may download beta version of new plugin here.
Install it over old plugin.

This plugin have new features. We'll correct documentation some later, but I think that you will have no problems while using of it.
Also it would be great if you will inform about testing of this plugin.
Post Reply