Hi all,
I have script that when run mounts a volume via afp, if it cannot it is to create a log on the desktop. this works great, but if there is ever a networ issue the script trigges a Finder error window that hangs the Finder. Is there a way to “silence” these error dialogs via the script so that it will only write to the log? Here is the script…
on run
try
tell application “Finder”
mount volume “afp://user:pass@ipaddress/mount”
end tell
on error the error_message number the error_number
set the error_text to "Error: " & the error_number & ". " & the error_message
– the following line evokes the sub-routine to write the error into an error log created on the desktop
– if the file “Script Error Log.txt” already exists, it will add one line to the log
my write_error_log(the error_text)
end try
end run
on write_error_log(this_error)
set the error_log to ((path to desktop) as text) & “Mount Volume Error.txt”
try
open for access file the error_log with write permission
write (this_error & return) to file the error_log starting at eof
close access file the error_log
on error
try
close access file the error_log
end try
end try
end write_error_log
Thanks, Chad
Model: G5
AppleScript: 2.0
Browser: Safari 312.3.1
Operating System: Mac OS X (10.4)