Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Jack9034

macrumors member
Original poster
Dec 17, 2011
96
0
Here is my script:

set a to display dialog "What server would you like to connect to?" default answer "Student Server Disks" with title "Connect to Server"
if text returned of a is "Student Server Disks" then
try
mount volume "afp://Student:student@server.schoolname.school.nz/"
end try
end if
if text returned of a is "Burt" then
try
mount volume "smb://Burt/Owner/"
end try
end if
if text returned of a is "Burts Laptop" then
try
mount volume "smb://burt-pc/burt/"
end try
end if
if text returned of a is "gurtrudes Laptop" then
try
mount volume "smb://gurtrude-pc/Gurtrude/"
end try
end if

How do I get an error message if the text in the display dialog is not valid. (eg. say i entered windowslaptop in the display dialog. Can I get an error message saying something like: Cannot connect to the server "windowslaptop") I want it to say Cannot connect to the server "whatever i entered in the display dialog".

Could someone please give me a script for that. Sorry I'm new to scripts and things...

THANKS!! :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.