Hi there I have a script that mounts a volume from our server. For some reason we seem to be getting an error on some machines were the mounted volume seems to dismount, but leaves the folder behind. So when you try to run the script again it mounts the volume with an increment on the end which is no good.
So I found a way around this, but I still have one issue.
if {"CAD_Setup"} is in paragraphs of (do shell script "/bin/ls /Volumes") then
do shell script "rm -d /Volumes/CAD_Setup/"
do shell script "umount /Volumes/CAD_Setup/"
end if
if {"CAD_Setup"} is not in paragraphs of (do shell script "/bin/ls /Volumes") then
do shell script "mkdir /Volumes/CAD_Setup/"
do shell script "mount -t afp afp://printerscript:hbhb@192.168.1.251/CAD_Setup /Volumes/CAD_Setup/"
end if
tell application "VectorWorks 2008"
activate
end tell
The firs section is were my problem is. If the folder already exists then it will remove it for me. If the Volume is already mounted then it will unmount it, but if one or the other is not there then it reports and error and stops the script from running. Is there any way to ignore the errors in the script so it will just carry on working?
if {"CAD_Setup"} is in paragraphs of (do shell script "/bin/ls /Volumes") then
do shell script "rm -d /Volumes/CAD_Setup/"
do shell script "umount /Volumes/CAD_Setup/"