Need Help With Dialog

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Need Help With Dialog

Post by CyberCitizen » Thu Apr 21, 2005 1:51 am

Hello,

I am still trying to get me head around the Dialog setup.

This is the Dialog Box I am trying to display.

What I am after is that if someone enters in some data & presses enter, the script jumps to a Label based on that name.

Eg. If someone enters a Confirmation Number, the script goes to Label>Conf As far as I am aware there should be a var with the name %SatTrakInput.DConfirmation_Number%

If anyone could please modify my script so that if the data is entered it goes to that label in the script or if cancel is pressed it goes to the Label>End Note that only one field will ever have data in it.

Thank You For Any Advanced Help You Can Provide.

Dialog>SatTrakInput
Caption=SatTrak Input Screen
Top=0
Width=416
Left=0
Height=138
Edit=DConfirmation_Number,16,40,185,
Edit=DTicket_Number,16,80,185,
Edit=DName,216,40,185,
Label=S a t T r a k I n p u t S c r e e n,8,0
Button=Send To SatTrak,256,0,99,25,0
Button=Cancel,360,0,43,25,0
Edit=DUsername,216,80,185,
Label=Confirmation Number,8,24
Label=Ticket Number,8,64
Label=Username,208,64
Label=Ticket Number,8,64
Label=Ticket Number,8,64
Label=Name,208,24
EndDialog>SatTrakInput

Label>Conf
MessageModal>%SatTrakInput.DConfirmation_Number%
Goto>End

Label>Tkt
MessageModal>%SatTrakInput.DTicket_Number%
Goto>End

Label>Name
MessageModal>%SatTrakInput.DName%
Goto>End

Label>User
MessageModal>%SatTrakInput.DUsername%
Goto>End

Label>End

--
Michael Allen
NURV | CyberCitizen

"If you spend more on coffee than on IT security, you will be hacked."
White House cybersecurity advisor, Richard Clarke

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Apr 21, 2005 3:00 am

Try this:

Dialog>SatTrakInput
Caption=SatTrak Input Screen
Top=0
Width=416
Left=0
Height=138
Edit=DConfirmation_Number,16,40,185,
Edit=DTicket_Number,16,80,185,
Edit=DName,216,40,185,
Label=S a t T r a k I n p u t S c r e e n,8,0
Button=Send To SatTrak,256,0,99,25,3
Button=Cancel,360,0,43,25,4
Edit=DUsername,216,80,185,
Label=Confirmation Number,8,24
Label=Username,208,64
Label=Ticket Number,8,64
Label=Name,208,24
EndDialog>SatTrakInput

Show>SatTrakInput,result

If>result=4,End
If>result=3,Test
If>result=2,End

Label>Test
If>%SatTrakInput.DConfirmation_Number%,Conf
If>%SatTrakInput.DTicket_Number%,Tkt
If>%SatTrakInput.DName%,Name
If>%SatTrakInput.DUsername%,User
Goto>End

Label>Conf
MessageModal>Confirmation Number =%CRLF% %SatTrakInput.DConfirmation_Number%
Goto>End

Label>Tkt
MessageModal>Ticket Number =%CRLF%%SatTrakInput.DTicket_Number%
Goto>End

Label>Name
MessageModal>Name =%CRLF%%SatTrakInput.DName%
Goto>End

Label>User
MessageModal>Username =%CRLF%%SatTrakInput.DUsername%
Goto>End

Label>End


Hope this was what you wanted. Do the additions make sense?
I'll have time to give you details tomorrow if you need them.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Thu Apr 21, 2005 3:19 am

Excellent, That Was Exactly What I Was After. I Will Now Add The Rest Of The Sdcript To If & See How It Goes. Thanks For Your Help.

I Will Have To Make Some Time & Learn The Dialog Options.
--
Michael Allen
NURV | CyberCitizen

"If you spend more on coffee than on IT security, you will be hacked."
White House cybersecurity advisor, Richard Clarke

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Thu May 05, 2005 12:50 am

Just to let you know, I now have my script working perfectly, however I have run into a small issue.

When a standard windows message box comes up if you press space or enter on the keyboad it closes the box as the ok button is selected by default.

What I am wanting to do is on my dialog box if the user presses enter is submit's the data & proceed's with the script instead on the user having to tab down to the submit box, or having to mouse click. Is there a way to make the button the default for key press?
FIREFIGHTER

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu May 05, 2005 2:48 am

Bad post. Please ignor.
Thanks,
Dick
Last edited by JRL on Sat May 07, 2005 2:41 am, edited 1 time in total.

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Fri May 06, 2005 5:15 am

This is an example of a Dialog that will complete and close whenever the Enter key is pressed. This is intended as a proof of concept and has not been thoroughly tested.

You may have to find your msched.exe file and change the path to it in the macro to make this work on your machine. Mine is in the default Macro Scheduler directory.

Because, shift + esc is pressed at the end, other running macros may inadvertently be closed.



DeleteFile>%TEMP_DIR%~pressenter~.scp
Dialog>Dialog1
Caption=Press Enter
Top=230
Width=451
Left=244
Height=319
Label=Test Edit Box,64,16
Label=Test Memo Box,184,88
Label=TAB 1,80,56
Label=TAB 2,328,56
Label=TAB 3,208,208
Label=TAB 4,208,272
Edit=msEdit1,40,32,121,
CheckBox=msCheckBox1,Test Check Box,304,32,97,False
Memo=msMemo1,128,112,185,89,
Button=OK,184,240,75,25,3
EndDialog>Dialog1

Let>k=0

WriteLn>%TEMP_DIR%~pressenter~.scp,result,WaitKeyDown>VK13
WriteLn>%TEMP_DIR%~pressenter~.scp,result,PushButton>Press Enter*,OK

Show>Dialog1

Label>ActionLoop
Let>k=k+1
GetDialogAction>Dialog1,r
if>r=3,exit
if>r=2,exit
If>k=1
Run Program>C:\Program Files\MJT Net Ltd\Macro Scheduler\msched.exe %TEMP_DIR%~pressenter~.scp
EndIf
Goto>ActionLoop

Label>exit
Press shift
Press Esc
Release shift

DeleteFile>%TEMP_DIR%~pressenter~.scp



Hope this was helpful,
Dick

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Wed May 11, 2005 6:14 am

Hello,

Thanks For Your Help JRL, Unfortunally The Script Does Not Work Well Enough With My Macro To Roll It Out. I Would Like To Hear From Support Regarding This One Though As I Am Sure There Is A Feature There That I Just Do Not Know About.
FIREFIGHTER

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed May 11, 2005 7:19 am

At present it is not possible to assign a default button to custom dialogs. Default buttons respond to the Enter key. We intend to provide the ability to assign one of the buttons as the default in the next version.
MJT Net Support
[email protected]

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Wed May 11, 2005 2:20 pm

Great, This Is What I Was Hoping For Before I Role Out My Macro To The Work PC's.
Last edited by CyberCitizen on Mon May 30, 2005 4:20 am, edited 1 time in total.
FIREFIGHTER

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Default Button For Dialog

Post by CyberCitizen » Mon May 30, 2005 4:19 am

The Next Version Was Release Yet I Do Not See This As A Feature Yet.

Version 7.3.11.4 25/05/2005

Fixed RetrievePop3 not terminating when macro quit while retrieving messages
Fixed AV when closing compiled exe by right clicking taskbar icon
Fixed AV in Win95/98 with listbox on custom dialog

Version 7.3.11.3 14/04/2005

Fixed startup error that could be caused by zero sized macro list column

Is There An ETA On When This Will Be Added To MS??? This Is One Of The Main Features I Am Waiting For From MS. I Would Also Like To Beable To Set A Background Picture For The Dialog Box As Well As Disable The Min, Max, & Close Buttons For The Dialog.
FIREFIGHTER

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Wed Aug 10, 2005 2:03 am

What No Response???

The Ticket's I Created In Bug Tracker Were Closed As Well Also Advising That It Will Be In The Next Release, However The Release Was Made & There Was No Change.

Can You Provide An ETA On When These Features Will Be Implemented?
FIREFIGHTER

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Aug 10, 2005 8:22 am

Whoa there! It is in the next release - 7.4 - which is currently in BETA. See: http://www.mjtnet.com/forum/viewtopic.php?p=8713

You will note in the list of additions/fixes that Default is included.

Download the beta, or wait for it's official release. Then add the following in a dialog block:

Default=ButtonName
MJT Net Support
[email protected]

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Wed Aug 10, 2005 8:24 am

Note also that 7.4 lets you disable Min,Max & Close buttons.

Background pictures are already possible by setting an image the size of the dialog. In 7.4 Set Resize=0 to that the dialog cannot be resized and you have a background image. Put other objects on top of it.
MJT Net Support
[email protected]

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