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!!
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!!