Can a preference be changed within a script

Can the “Alert user when script execution fails” preference be changed from within a script? I can’t seem to find reference to that. I know you can set a lot of others though.

Thanks for the help.


Not at this time.

As an alternative, if you have that preference OFF by default you could use a snippet like this exception handler at the top level of your script to accomplish much the same thing.

set AlertUserToFail to false
    ...all my code...
    set AlertUserToFail to true
    ...all my code...
catch theException
    if AlertUserToFail then Answer "Your Script Is About To Fail"
    throw theException
end catch