Re: Suppressing the error dialog box
Re: Suppressing the error dialog box
- Subject: Re: Suppressing the error dialog box
- From: Yvan KOENIG <email@hidden>
- Date: Fri, 21 May 2010 09:53:29 +0200
Le 21 mai 2010 à 09:04, Tom Horton a écrit :
I'm need to detect an error in my AppleScript using on error, but I
don't want to see the dialog box prompting me with OK or Cancel. I
just need to know there was an error.
Is there an option to suppress the error dialog?
Thanks
One track may be :
try
the_instruction
on error errMsg number errNbr
set trapReport to "trap #xxx"&return &errMsg&" number : "&errNbr
say trapReport
end try
An other one which I often use is
set report to ""
…
try
the_instruction
on error errMsg number errNbr
set trapReport to return &"trap #xxx"&return &errMsg&" number :
"&errNbr
set report to report & trapReport
set the clipboard to report
end try
…
With that, even if the script fails, I'm able to grab the 'report'
from the clipboard.
A third track would be to write trapReport in a text file.
Yvan KOENIG (VALLAURIS, France) vendredi 21 mai 2010 09:53:22
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden