Solved

Applescript that directs user depending on text input

Posted on 2006-06-30
3
978 Views
Last Modified: 2013-12-26
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
Comment
Question by:arobquinna
  • 2
3 Comments
 
LVL 24

Accepted Solution

by:
slyong earned 500 total points
ID: 17136486
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
 

Author Comment

by:arobquinna
ID: 17141731
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
 
LVL 24

Expert Comment

by:slyong
ID: 17142589
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Separate into files by filename 12 82
has77  challenge 9 85
My project did see openJDK that I installed. What could be the problem 7 142
Problem to App 4 82
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question