Error Numbers and Error Messages

This appendix describes error numbers and error messages provided by AppleScript, as well as certain Mac OS error numbers that may be of interest to scripters.

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>.