windowchanged timeout......

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
shocam
Newbie
Posts: 16
Joined: Thu Jun 08, 2006 8:03 am

windowchanged timeout......

Post by shocam » Thu Jun 08, 2006 8:37 am

Hi, i have created a script which helps users log into various programs but i am having problems with the following lines:

WaitWindowOpen>windowtowatch*
Let>WWC_TIMEOUT=5
WaitWindowChanged>windowtowatch*
If>WWC_RESULT=FALSE
what to do
EndIf

For some reason the timeout is not working and it just waits indefinitely.

Also, on a different note.......is it possible to enable/disable a group of scheduled scripts using a radio button?

Thanks for any help you can give me

Mike

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jun 08, 2006 8:50 am

You have the syntax for WaitWindowChanged wrong. This command waits for the foreground window to change, so does not need a window title, and just takes a timeout value (in seconds). So you want:

WaitWindowOpen>windowtowatch*
WaitWindowChanged>5
If>WWC_RESULT=FALSE
...what to do
EndIf
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

shocam
Newbie
Posts: 16
Joined: Thu Jun 08, 2006 8:03 am

Post by shocam » Thu Jun 08, 2006 9:21 am

Thanks Marcus, works like a charm. I knew it would be something simple!!! :oops:

Did you have any thoughts on my second question?

Thanks

Mike

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jun 08, 2006 9:35 am

Sorry. No, there's no way built into the interface to disable/enable a group of scripts together at once.

But what you can do is have each of these scripts check an INI file before they do anything else. In this INI file you set a flag that tells the script whether or not they should continue. Then all you need is another controlling script which modifies this INI file.

E.g. if the INI file looks like this:

[scriptcontrol]
enabled=YES

And at the start of each script have:

ReadIniFile>filename,scriptcontrol,enabled,continue
If>continue=YES
..
.. rest of script here
..
EndIf

And then all you need is one controlling script that lets you set this INI file using the EditIniFile command:

//to enable:
EditIniFile>filename,scriptcontrol,enabled,YES

//to disable:
EditIniFile>filename,scriptcontrol,enabled,NO

This method gives you complete flexibility and provides a semaphore technique for controlling scripts or parts of script code from another macro or program.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

shocam
Newbie
Posts: 16
Joined: Thu Jun 08, 2006 8:03 am

Post by shocam » Thu Jun 08, 2006 9:41 am

Thanks again Marcus, that sounds like it should do exactly what I want, ill give it a go.......

Maybe that could be an idea for the next version of MS. Having the ability to control whether a group of scheduled tasks is enabled or not. This would enable a group of user to have MS running, but only one of them actually running scheduled tasks.

Mike

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts