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

-2700

Unknown error.

-2701

Can’t divide <number> by zero.

-2702

The result of a numeric operation was too large.

-2703

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

-2704

<reference> isn't scriptable.

-2705

The application has a corrupted dictionary.

-2706

Stack overflow.

-2707

Internal table overflow.

-2708

Attempt to create a value larger than the allowable size.

-2709

Can't get the event dictionary.

-2720

Can't both consider and ignore <attribute>.

-2721

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

-2729

Message size too large for the 7.0 Finder.

-2740

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

-2741

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

-2750

The <name> parameter is specified more than once.

-2751

The <name> property is specified more than once.

-2752

The <name> handler is specified more than once.

-2753

The variable <name> is not defined.

-2754

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

-2755

Exit statement was not in a repeat loop.

-2760

Tell statements are nested too deeply.

-2761

<name> is illegal as a formal parameter.

-2762

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

-2763

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

0

No error.

-34

Disk <name> full.

-35

Disk <name> wasn’t found.

-37

Bad name for file

-38

File <name> wasn’t open.

-39

End of file error.

-42

Too many files open.

-43

File <name> wasn’t found.

-44

Disk <name> is write protected.

-45

File <name> is locked.

-46

Disk <name> is locked.

-47

File <name> is busy.

-48

Duplicate file name.

-49

File <name> is already open.

-50

Parameter error.

-51

File reference number error.

-61

File not open with write permission.

-108

Out of memory.

-120

Folder <name> wasn’t found.

-124

Disk <name> is disconnected.

-128

User cancelled.

-192

A resource wasn’t found.

-600

Application isn’t running

-601

Not enough room to launch application with special requirements.

-602

Application is not 32-bit clean.

-605

More memory needed than is specified in the size resource.

-606

Application is background-only.

-607

Buffer is too small.

-608

No outstanding high-level event.

-609

Connection is invalid.

-904

Not enough system memory to connect to remote application.

-905

Remote access is not allowed.

-906

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

-915

Can’t find remote machine.

-30720

Invalid date and time <date string>.