forked from DonovanChan/fmfunctions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathErrorTextAppleScript.calc
148 lines (137 loc) · 7.57 KB
/
ErrorTextAppleScript.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
Case (
//-- Operating system errors
errorNum = 0 ; "No error." ;
errorNum = -34 ; "Disk <name> full." ;
errorNum = -35 ; "Disk <name> wasn’t found." ;
errorNum = -37 ; "Bad name for file" ;
errorNum = -38 ; "File <name> wasn’t open." ;
errorNum = -39 ; "End of file error." ;
errorNum = -42 ; "Too many files open." ;
errorNum = -43 ; "File <name> wasn’t found." ;
errorNum = -44 ; "Disk <name> is write protected." ;
errorNum = -45 ; "File <name> is locked." ;
errorNum = -46 ; "Disk <name> is locked." ;
errorNum = -47 ; "File <name> is busy." ;
errorNum = -48 ; "Duplicate file name." ;
errorNum = -49 ; "File <name> is already open." ;
errorNum = -50 ; "Parameter error." ;
errorNum = -51 ; "File reference number error." ;
errorNum = -61 ; "File not open with write permission." ;
errorNum = -108 ; "Out of memory." ;
errorNum = -120 ; "Folder <name> wasn’t found." ;
errorNum = -124 ; "Disk <name> is disconnected." ;
errorNum = -128 ; "User cancelled." ;
errorNum = -192 ; "A resource wasn’t found." ;
errorNum = -600 ; "Application isn’t running" ;
errorNum = -601 ; "Not enough room to launch application with special requirements." ;
errorNum = -602 ; "Application is not 32-bit clean." ;
errorNum = -605 ; "More memory needed than is specified in the size resource." ;
errorNum = -606 ; "Application is background-only." ;
errorNum = -607 ; "Buffer is too small." ;
errorNum = -608 ; "No outstanding high-level event." ;
errorNum = -609 ; "Connection is invalid." ;
errorNum = -904 ; "Not enough system memory to connect to remote application." ;
errorNum = -905 ; "Remote access is not allowed." ;
errorNum = -906 ; "<name> isn’t running or program linking isn’t enabled." ;
errorNum = -915 ; "Can’t find remote machine." ;
errorNum = -30720 ; "Invalid date and time <date string>." ;
//-- Apple event errors
errorNum = -1700 ; "Can't make some data into the expected type." ;
errorNum = -1701 ; "Some parameter is missing for <commandName>" ;
errorNum = -1702 ; "Some data could not be read" ;
errorNum = -1703 ; "Some data was the wrong type." ;
errorNum = -1704 ; "Some parameter was invalid." ;
errorNum = -1705 ; "Operation involving a list item failed." ;
errorNum = -1706 ; "Need a newer version of the AppleEvent manager." ;
errorNum = -1707 ; "Event isn't an AppleEvent." ;
errorNum = -1708 ; "<reference> doesn't understand the <commandName> message." ;
errorNum = -1709 ; "AEResetTimer was passed an invalid reply." ;
errorNum = -1710 ; "Invalid sending mode was passed." ;
errorNum = -1711 ; "User canceled out of wait loop for reply or receipt." ;
errorNum = -1712 ; "AppleEvent timed out." ;
errorNum = -1713 ; "No user interaction allowed." ;
errorNum = -1714 ; "Wrong keyword for a special function." ;
errorNum = -1715 ; "Some parameter wasn't understood." ;
errorNum = -1716 ; "Unknown AppleEvent address type." ;
errorNum = -1717 ; "The handler <identifier> is not defined." ;
errorNum = -1718 ; "Reply has not yet arrived." ;
errorNum = -1719 ; "Can't get <reference>. Invalid index." ;
errorNum = -1720 ; "Invalid range." ;
errorNum = -1721 ; "<expression> doesn't match the parameters <parameterNames> for <commandName>." ;
errorNum = -1723 ; "Can't get <expression>. Access not allowed." ;
errorNum = -1725 ; "Illegal logical operator called." ;
errorNum = -1726 ; "Illegal comparison or logical." ;
errorNum = -1727 ; "Expected a reference." ;
errorNum = -1728 ; "Can't get <reference>." ;
errorNum = -1729 ; "Object counting procedure returned a negative count." ;
errorNum = -1730 ; "Container specified was an empty list." ;
errorNum = -1731 ; "Unknown object type." ;
errorNum = -1750 ; "Scripting component error." ;
errorNum = -1751 ; "Invalid script id." ;
errorNum = -1752 ; "Script doesn't seem to belong to AppleScript." ;
errorNum = -1753 ; "Script error." ;
errorNum = -1754 ; "Invalid selector given." ;
errorNum = -1755 ; "Invalid access." ;
errorNum = -1756 ; "Source not available." ;
errorNum = -1757 ; "No such dialect." ;
errorNum = -1758 ; "Data couldn't be read because its format is obsolete." ;
errorNum = -1759 ; "Data couldn't be read because its format is too new." ;
errorNum = -1760 ; "Recording is already on." ;
//-- AppleScript errors
errorNum = -2700 ; "Unknown error." ;
errorNum = -2701 ; "Can’t divide <number> by zero." ;
errorNum = -2702 ; "The result of a numeric operation was too large." ;
errorNum = -2703 ; "<reference> can't be launched because it is not an application." ;
errorNum = -2704 ; "<reference> isn't scriptable." ;
errorNum = -2705 ; "The application has a corrupted dictionary." ;
errorNum = -2706 ; "Stack overflow." ;
errorNum = -2707 ; "Internal table overflow." ;
errorNum = -2708 ; "Attempt to create a value larger than the allowable size." ;
errorNum = -2709 ; "Can't get the event dictionary." ;
errorNum = -2720 ; "Can't both consider and ignore <attribute>." ;
errorNum = -2721 ; "Can't perform operation on text longer than 32K bytes." ;
errorNum = -2729 ; "Message size too large for the 7.0 Finder." ;
errorNum = -2740 ; "A <language element> can't go after this <language element>." ;
errorNum = -2741 ; "Expected <language element> but found <language element>." ;
errorNum = -2750 ; "The <name> parameter is specified more than once." ;
errorNum = -2751 ; "The <name> property is specified more than once." ;
errorNum = -2752 ; "The <name> handler is specified more than once." ;
errorNum = -2753 ; "The variable <name> is not defined." ;
errorNum = -2754 ; "Can't declare <name> as both a local and global variable." ;
errorNum = -2755 ; "Exit statement was not in a repeat loop." ;
errorNum = -2760 ; "Tell statements are nested too deeply." ;
errorNum = -2761 ; "<name> is illegal as a formal parameter." ;
errorNum = -2762 ; "<name> is not a parameter name for the event <event>." ;
errorNum = -2763 ; "No result was returned for some argument of this expression." ;
//-- Apple event registry errors
errorNum = -10000 ; "AppleEvent handler failed." ;
errorNum = -10001 ; "A descriptor type mismatch occurred." ;
errorNum = -10002 ; "Invalid key form." ;
errorNum = -10003 ; "Can't set <object or data> to <object or data>. Access not allowed." ;
errorNum = -10004 ; "A privilege violation occurred." ;
errorNum = -10005 ; "The read operation wasn't allowed." ;
errorNum = -10006 ; "Can't set <object or data> to <object or data>." ;
errorNum = -10007 ; "The index of the event is too large to be valid." ;
errorNum = -10008 ; "The specified object is a property, not an element." ;
errorNum = -10009 ; "Can't supply the requested descriptor type for the data." ;
errorNum = -10010 ; "The AppleEvent handler can't handle objects of this class." ;
errorNum = -10011 ; "Couldn't handle this command because it wasn't part of the current transaction." ;
errorNum = -10012 ; "The transaction to which this command belonged isn't a valid transaction." ;
errorNum = -10013 ; "There is no user selection." ;
errorNum = -10014 ; "Handler only handles single objects." ;
errorNum = -10015 ; "Can't undo the previous AppleEvent or user action."
//-- Custom errors (add your own here)
)
/* —————————————————————————————— //
NAME:
ErrorTextAppleScript ( errorNum )
PURPOSE:
Returns text description of error code for AppleScript and OS errors (Mac OS)
EXAMPLES:
ErrorTextAppleScript ( -2700 ) = "Unknown error."
NOTES:
Source of errors: http://developer.apple.com/library/mac/#documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_error_codes.html#//apple_ref/doc/uid/TP40000983-CH220-SW5
HISTORY:
Created: 2011-Sep-22 18h33 PST — Donovan A. Chandler
Modified: 2011-Nov-14 11h12 PST — Donovan Chandler ; Added Apple Event errors
*/