WaitPixelChange when dialog is open

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
bjorn82dk
Newbie
Posts: 13
Joined: Sat Jun 23, 2012 10:41 am
Location: Copgenhagen, Denmark

WaitPixelChange when dialog is open

Post by bjorn82dk » Sat Apr 22, 2023 1:18 pm

Hi all,
I'm running the following script where I display a dialogbox - when a specifc pixel color is present I would like the dialog to close, for some reason this is not working. What am I doing incorrect?


//Place dialog
SetDialogProperty>Dialog1,,Position,poDesigned
SetDialogProperty>Dialog1,,Left,785
SetDialogProperty>Dialog1,,Top,40

SetDialogProperty>Dialog1,MSMemo1,Text,Select: %Resultat%

//Display Dialog
Show>Dialog1,res
Wait>0.5


SetFocus>AnyDesk*
Wait>0.5
WaitPixelColor>%nGreenCircle%,391,295,0
Wait>0.5

CloseDialog>Dialog1
SetFocus>AnyDesk*
Wait>0.5

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1389
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: WaitPixelChange when dialog is open

Post by Dorian (MJT support) » Sat Apr 22, 2023 3:23 pm

You're using a modal dialog.

Try this :

Code: Select all

//Place dialog
SetDialogProperty>Dialog1,,Position,poDesigned
SetDialogProperty>Dialog1,,Left,785
SetDialogProperty>Dialog1,,Top,40

SetDialogProperty>Dialog1,MSMemo1,Text,Select: %Resultat%

//Display Dialog
Show>Dialog1
Wait>0.5


SetFocus>AnyDesk*
Wait>0.5
WaitPixelColor>%nGreenCircle%,391,295,0
Wait>0.5

CloseDialog>Dialog1
SetFocus>AnyDesk*
Wait>0.5
Yes, we have a Custom Scripting Service. Message me or go here

bjorn82dk
Newbie
Posts: 13
Joined: Sat Jun 23, 2012 10:41 am
Location: Copgenhagen, Denmark

Re: WaitPixelChange when dialog is open

Post by bjorn82dk » Mon Apr 24, 2023 3:30 pm

That was the mistake - thanks Dorian you are a life savor.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1389
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: WaitPixelChange when dialog is open

Post by Dorian (MJT support) » Mon Apr 24, 2023 3:49 pm

Always happy to help.
Yes, we have a Custom Scripting Service. Message me or go here

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