Error message suppression?

Hi

I have a script running that checks to see if an ichat audio chat is running…if it isn’t it restarts the a(v) audio channel.

That part is all working well except when the second user (the user i am connecting to) is not there it throws up two error messages one from applescript saying the:

‘script encountered an error’

and the other from ichat saying:

‘The conference could not be started because user (sonicwells) was busy in another conference.’

Does anyone know how to suppress the dialogues?

The problem is I want to schedule both machines to completely shutdown at the end of the night and restart the next morning, the terminal commands will not kill the scripts if there are dialogues open and awaiting a response.

Any help would be appreciated, I could send the script later on when I get home from work.

Model: Mac mini, Leopard
Browser: Safari 525.13
Operating System: Mac OS X (10.5)

Hi jameisterschlam,

You can suppress error messages in AppleScript with a «try»-block.

Normally the following code would raise an exception:


set x to 1 / 0
-- Can't divide 1.0 by zero.

But if you enclose the expression in a «try»-block, the exception is ignored:


try
	set x to 1 / 0
end try
-- nothing happens

So if you want to suppress error messages in your code, you can enclose the regarding code parts in «try»-blocks.

Hi Martin

Thanks for the tip that has managed to resolve half the issue which is great!!

It still causes iChat to also throw up an error message do you think there is any way of preventing that?

Best wishes
Jamil

Model: mac mini
Browser: Safari 525.20.1
Operating System: Mac OS X (10.5)

Hi again

Actually a killall -9 iChat seems to do the trick!!

So even though it isn’t clean at least I have a solution

Thanks for all your input!!

Best
Jamil