WaitScreenImage + IF

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
rfseifer
Newbie
Posts: 1
Joined: Tue Aug 01, 2017 4:41 am

WaitScreenImage + IF

Post by rfseifer » Tue Aug 01, 2017 4:58 am

Hi all,

I just started using Macro Scheduler, would appreciate any input.
To put it into perspective, I need to capture 2 responses based on image.
If this image appears, do this. If the other image appears, do that. The image only appears once in each execution, so it's either this or the other.

I could have use a ELSE statement, but I might be expecting a 3rd image in future.

Thanks for the kind help in advance.

Code: Select all

    Let>WSI_TIMEOUT=900
      IF
        //Wait for 
        WaitScreenImage>C:\Macro Scheduler 14\InstalledWithWarning.bmp,0.7,CCOEFF
        
        Do this

      Endif
      
      IF
        //Wait for 
        WaitScreenImage>C:\Macro Scheduler 14\InstalledFailed.bmp,0.7,CCOEFF
        
        Do that
      
      Endif

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

Re: WaitScreenImage + IF

Post by Marcus Tettmar » Wed Aug 02, 2017 6:45 am

I'm not sure why you can't use an Else statement. You can have as many nested If/Else/Endif blocks as you want, so you can accommodate a third image, or more.

Alternatively, check the WSI_RESULT variable to see if a match was found and only do your second check if it wasn't.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

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