Error Numbers and Error Messages

This appendix describes error numbers and error messages provided by AppleScript and macOS.

AppleScript Errors

An AppleScript error is an error that occurs when AppleScript processes script statements. Nearly all of these are of interest to users. For errors returned by an application, see the documentation for that application.

Table B-1  AppleScript errors

Error number

Error message


Unknown error.


Can’t divide <number> by zero.


The result of a numeric operation was too large.


<reference> can't be launched because it is not an application.


<reference> isn't scriptable.


The application has a corrupted dictionary.


Stack overflow.


Internal table overflow.


Attempt to create a value larger than the allowable size.


Can't get the event dictionary.


Can't both consider and ignore <attribute>.


Can't perform operation on text longer than 32K bytes.


Message size too large for the 7.0 Finder.


A <language element> can't go after this <language element>.


Expected <language element> but found <language element>.


The <name> parameter is specified more than once.


The <name> property is specified more than once.


The <name> handler is specified more than once.


The variable <name> is not defined.


Can't declare <name> as both a local and global variable.


Exit statement was not in a repeat loop.


Tell statements are nested too deeply.


<name> is illegal as a formal parameter.


<name> is not a parameter name for the event <event>.


No result was returned for some argument of this expression.

Operating System Errors

An operating system error is an error that occurs when AppleScript or an application requests services from the Mac OS. They are rare, and often there is nothing you can do about them in a script, other than report them. A few, such as "User canceled", make sense for scripts to handle—as shown, for an example, in the Examples section for the display dialog command.

Table B-2  Mac OS errors

Error number

Error message


No error.


Disk <name> full.


Disk <name> wasn’t found.


Bad name for file


File <name> wasn’t open.


End of file error.


Too many files open.


File <name> wasn’t found.


Disk <name> is write protected.


File <name> is locked.


Disk <name> is locked.


File <name> is busy.


Duplicate file name.


File <name> is already open.


Parameter error.


File reference number error.


File not open with write permission.


Out of memory.


Folder <name> wasn’t found.


Disk <name> is disconnected.


User cancelled.


A resource wasn’t found.


Application isn’t running


Not enough room to launch application with special requirements.


Application is not 32-bit clean.


More memory needed than is specified in the size resource.


Application is background-only.


Buffer is too small.


No outstanding high-level event.


Connection is invalid.


Not enough system memory to connect to remote application.


Remote access is not allowed.


<name> isn’t running or program linking isn’t enabled.


Can’t find remote machine.


Invalid date and time <date string>.

Apple Event Errors

An Apple event error may occur when an app attempts to process an event sent by a script or a script attempts to process the reply.

Table B-3  Apple Event Manager errors

Error number

Error message


Bad parameter data was detected or there was a failure while performing a coercion.


An Apple event description was not found.


Corrupt data was detected.


The wrong data type was detected.


An invalid Apple event description was detected.


The specified list item doesn’t exist.


A newer version of Apple Event Manager is required to perform this operation.


The event isn’t an Apple event.


The script doesn’t understand the <message> message. The event was not handled.


An invalid reply parameter was received by AEResetTimer.


An invalid sending mode (something other than NoReply, WaitReply, or QueueReply) was detected or interaction level is unknown.


The user canceled while waiting for an event reply.


The Apple event has timed out.


User interaction is not allowed.


There is no special function for this keyword.


A required parameter is missing.


The target address type of an Apple event is unknown.


Unable to find a matching event or coercion handler.


Unable to access the contents of an event reply because the reply hasn’t been received yet.


The specified index is invalid or out of range.


The specified range is invalid, such as 3rd to 2nd or 1st to all.


The wrong number of arguments was detected.


The accessor was not found.


There is no such Boolean operator.


An invalid comparison was made or an invalid logical descriptor was detected.


AEResolve was given a non-object parameter.


The referenced object doesn’t exist. This is a run-time resolution error, such as when attempting to reference a third object when only two objects exist.


An object counting procedure returned a negative value.


Attempted to pass an empty list to an accessor.


An unknown type of object was detected.


The Apple event handler failed.


A type mismatch has occurred.


Invalid key form was detected.


The specified object cannot be modified.


A privilege error has occurred.


The read operation was denied.


The write operation was denied.


The object index is too large.


The specified object is not an element.


Unable to provide the requested type.


The Apple event handler doesn’t support the specified class.


The event is not part of the current transaction.


There is no such transaction.


Nothing is selected by the user.


The Apple event handler only handles single objects.


The previous action can’t be undone.


The Apple event handler does not handle remote events.


The specified constant value is invalid for this property.


The specified class can’t be an element of the specified container, such as when attempting to make or duplicate an object.


An invalid combination of properties was provided, such as for the set, make, or duplicate command.

Open Scripting Architecture Errors

An Open Scripting Architecture error may occur when the scripting system itself encounters an error.

Table B-4  Open Scripting Architecture errors

Error number

Error message


A scripting component error has occurred.


An invalid script ID was detected.


The script isn’t a supported type.


A script error has occurred.


A bad selector was detected.


The source is not available.


There is no matching dialect.


The data format is obsolete.


The data format is too new.


There is a component mismatch—parameters are from two different components.


Unable to connect to the scripting system matching the specified ID.


Unable to store memory pointers in a saved script.