As was pointed out to me, you need the name of the event handler and
then you need the rest of the script to handle the dialog.
Here is a sample dialog.vbs:
' This example creates a more complex message box with a yes button, 
' a no button, and a cancel button.

Set MyMessageBox = SharedObjects("com.GWMicro.MessageBox").NewDialog
MyMessageBox.Title = "My Message Box"
MyMessageBox.Message = "This is a message. Do you want to continue?"
MyMessageBox.AddButton "Yes", "y"
MyMessageBox.AddButton "No", "n"
MyMessageBox.AddButton "Cancel", "c"
MyMessageBox.DefaultButton = "Yes"
MyMessageBox.CancelButton = "Cancel"
Dim returnValue : returnValue = MyMessageBox.Show
' If the Yes button is selected, returnValue will contain the string
"Yes."
' If the No button is selected, returnValue will contain the string
"No."
' If the Cancel button is selected, returnValue will contain the string
"Cancel."
 

-----Original Message-----
From: Kevin Huber [mailto:[email protected]] 
Sent: Monday, February 02, 2009 1:42 PM
To: gw-scripting
Subject: trying to run sample code

Hi:
I am trying to run the sample dialogs provided in the Window-eyes
Scripting manual, but I am encountering the following problem:
I have created a file called Messagebox.xml containing the following
code:
<?xml version="1.0"?>
<wescriptui>
<dialog id="mymessagebox" sysmenu="yes" minimize="no">
My Message Box
<group childalign="center" justify="full">
<static textalign="center">Hello World!</static>
<spacer/>
<button width="+30">OK</button>
</group>
</dialog>
</wescriptui>
I am trying to bring up the dialog from an Immediate Mode window using
the following statement:
Dialog "messagebox.xml", "mymessagebox"
However, I am getting the following error:
Dialog "messagebox.xml", "mymessagebox"
What am I doing wrong and how do I correct the problem?
Kevin Huber

Reply via email to