Sets a script error number that is associated with the execution of the command and is returned in the reply Apple event, if a reply was requested by the sender.
- macOS 10.0+
An error number to associate with the command.
If you override
perform and an error occurs, you should call this method to supply an appropriate error number. In fact, any script handler should call this method when an error occurs. The error number you supply is returned in the reply Apple event.
set causes an error message to be displayed. To associate a specific error message with the error number, you invoke
script. This make sense, for example, when you set an error number that is specific to your application, or when you can supply a specific and useful error message to the user.
set is invoked on an
NSScript with multiple receivers, the command will stop sending command handling messages to more receivers.