I'm new here

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
jj45410
Junior Coder
Posts: 38
Joined: Tue Nov 18, 2008 8:14 pm

I'm new here

Post by jj45410 » Tue Nov 18, 2008 9:10 pm

Hi, I'm kind of new to macro scheduler scripting... I've tried some javascript, java and I know a fair bit of that but VB script is sort of new to me. I learn by actually looking at the code and I was wondering how to make a menu that could open up and show all my favorite websites. If someone could please make a menu that has just 3 random websites listed and if I were to click on one it would let me vist that site. So I could read it and look at the code and see how it is done. Thank you.

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

Post by JRL » Tue Nov 18, 2008 9:44 pm

I like the easy questions:

Code: Select all

Dialog>Dialog1
   Caption=Websites
   Width=445
   Height=156
   Top=CENTER
   Left=CENTER
   Button=Mjtnet.com,24,16,385,25,10
   Button=Google.com,24,48,385,25,11
   Button=msn.com,24,80,385,25,12
EndDialog>Dialog1

Show>dialog1,res1
If>res1=10
  Exe>http://www.mjtnet.com
EndIf
If>res1=11
  Exe>http://www.google.com
EndIf
If>res1=12
  Exe>http://www.msn.com
EndIf

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Nov 18, 2008 9:53 pm

You're also great with the easy answers. :wink:

Well done.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

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

Post by JRL » Tue Nov 18, 2008 9:56 pm

Here' s the same thing using a listbox:

Code: Select all

Dialog>Dialog1
   Caption=Websites
   Width=519
   Height=176
   Top=CENTER
   Left=CENTER
   Button=Ok,216,112,75,25,3
   ListBox=msListBox1,40,16,425,73,Mjtnet.com%CRLF%Google.com%CRLF%msn.com
EndDialog>Dialog1

Show>dialog1,res1

If>dialog1.mslistbox1.itemindex=0
  Exe>http://www.mjtnet.com
EndIf
If>dialog1.mslistbox1.itemindex=1
  Exe>http://www.google.com
EndIf
If>dialog1.mslistbox1.itemindex=2
  Exe>http://www.msn.com
EndIf

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