Solved

Applescript that directs user depending on text input

Posted on 2006-06-30
3
971 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now