|May 5, 2012, 09:59 PM||#1|
AppleScript Editor Question
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
mount volume "afp://Student:email@example.com/"
if text returned of a is "Burt" then
mount volume "smb://Burt/Owner/"
if text returned of a is "Burts Laptop" then
mount volume "smb://burt-pc/burt/"
if text returned of a is "gurtrudes Laptop" then
mount volume "smb://gurtrude-pc/Gurtrude/"
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...
15" Retina MacBook Pro, 2.3GHz, 8GB RAM, 256GB SSD
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Upgrade AppleScript editor||tcpms||Mac Applications and Mac App Store||5||Apr 14, 2014 11:49 AM|
|Possible AppleScript question||Telp||Mac Basics and Help||2||Mar 28, 2014 11:04 PM|
|\n within regex gets replaced with new line by AppleScript Editor||poobear||Mac Programming||7||Jun 27, 2012 06:51 PM|
|iCal "Run Script" alert opens .scpt file in AppleScript Editor instead of running it||drskot||Mac Programming||3||Jun 7, 2012 01:47 PM|
All times are GMT -5. The time now is 01:04 PM.