Message Boxes in OS 9

HI

I have a very special problem with Scripting some Programs.
Is there any way to handle the bad Message Boxes (Warnings, Errors etc.) with AppleScript? Can i deactivate them or can I close them in any way with AppleScript?

The problem is, that every time such a Box pops up, my script is being stopped!

Please help me!

Greetz Pesse

That depends Greetz.

Usually you can avoid these messages by wrapping the line of code that causes it with

try
--whatever line of code is failing
end try

So first you would have to know which line(s) of code are causing the error.

You can also add a reaction for when the error occurs by using “on error”

try
--whatever line of code is failing
on error--goes here only if the last line fails
--do something else here
end try

I say “usually” this works because I have scripted applications that have very limited dictionary’s and have been limited to performing functions by invoking keystrokes. Using try - on error when invoking keystrokes does not ensure proper error handling as the try statement is directed at the keystroke rather than the task it invokes.

Good luck!

HI

Yeah, I know about the Try - On Error functions.
I’m really not a Newbee in AS and so, this way doesn’t tell me something new sorry

My question was about the Boxes you CAN’T handle with the try statement. In some Programs, there are Message Boxes if a special function is called for example. I can’t catch them with the try statement.
Have you any idea, how I can handle these ones?
I thought about making a try block (because after 1 minute, AS gets a “event timed out” error) and try to close the Message box with a press of the enter-key (Sändi’s Additions has this ability) but is this really the only, very dirty and uncomfortable way?

Thanks for any ideas!

Greetz Pesse

Greetz,

Perhaps you could share the program you are having trouble with.

Best

It’s a global Problem, but specially with the Image-Database “Cumulus” (Canto) I have the Problems with the Message Boxes.
I don’t know if you know anything about this program. It’s not too popular

Greetz Pesse