Solved

Applescript that directs user depending on text input

Posted on 2006-06-30
3
993 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

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 …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

691 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