• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 999
  • Last Modified:

Applescript that directs user depending on text input

does anyone know how to create an Applescript that will go to a certain page based on the users input into a text field?

Basically I would like a dialog box with a text field, once a user enters "aaa" they would go to index001.html, if they entered "bbb" they would go to index002.html etc...
0
arobquinna
Asked:
arobquinna
  • 2
1 Solution
 
slyongCommented:
Hi,

I am surprised no one take on this... here's a basic idea:

tell application "Finder"
       activate
       display dialog "Where do you want to go today?"
                default answer "aaa"
       set dialogInfo to result
       set gowhere to text returned of dialogInfo
end tell
tell application "Safari"
       activate
       if gowhere is equal to "aaa" then
               open location "http://www.yourdomain.com/index001.html"
       end if
end tell
0
 
arobquinnaAuthor Commented:
Thank you Slylong,

I was able to build exactly what I needed with this example.  I was begining to think I was on the "pay no mind list", your help is greatly appreciated.
0
 
slyongCommented:
No worries.  Just feel sorry for not able to answer you earlier.  I didn't have the time to test out the scripts and thought that someone would pick it up but had a look at it yesterday and decided to hack up the script. :D  Thanks for the points
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now