Dialog already exists error

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Grovkillen
Automation Wizard
Posts: 1021
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Dialog already exists error

Post by Grovkillen » Thu Feb 18, 2021 6:56 am

I get the error "A dialog called Dialog1 already exists." when the MouseEnter event is triggered.

MWE (minimal "working" example):

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
end
EndDialog>Dialog1

AddDialogHandler>Dialog1,,OnMouseEnter,MessagePopUp,entering
//AddDialogHandler>Dialog1,,OnMouseLeave,MessagePopUp,leaving

Show>Dialog1

Label>StartOver
Wait>0.1
GoTo>StartOver

SRT>MessagePopUp
  Message>%MessagePopUp_Var_1%
END>MessagePopUp
What's causing this... I cannot see my mistake here. Please advice.
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Grovkillen
Automation Wizard
Posts: 1021
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Dialog already exists error

Post by Grovkillen » Thu Feb 18, 2021 10:10 am

Found it.. I wasn't passing the sub variables according to the syntax:

Code: Select all

AddDialogHandler>Dialog1,,OnMouseEnter,MessagePopUp(entering)
AddDialogHandler>Dialog1,,OnMouseLeave,MessagePopUp(leaving)
The funny part is that the script's sub routine still got those parameters using the incorrect syntax.
Let>ME=%Script%

Running: 15.0.24
version history

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

Re: Dialog already exists error

Post by Dorian (MJT support) » Thu Feb 18, 2021 10:23 am

You saved me a job. I was just looking at this. :D
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 1021
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Dialog already exists error

Post by Grovkillen » Thu Feb 18, 2021 11:33 am

Nice to be of assistance :)
Let>ME=%Script%

Running: 15.0.24
version history

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