-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAppleScript.h
248 lines (208 loc) · 6.95 KB
/
AppleScript.h
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
/*
File: AppleScript.h
Contains: AppleScript Specific Interfaces.
Version: Technology: AppleScript 1.1
Release: Universal Interfaces 3.4
Copyright: © 1992-2001 by Apple Computer, Inc., all rights reserved
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com/bugreporter/
*/
#ifndef __APPLESCRIPT__
#define __APPLESCRIPT__
#ifndef __MACERRORS__
#include <MacErrors.h>
#endif
#ifndef __APPLEEVENTS__
#include <AppleEvents.h>
#endif
#ifndef __OSA__
#include <OSA.h>
#endif
#ifndef __TEXTEDIT__
#include <TextEdit.h>
#endif
#if PRAGMA_ONCE
#pragma once
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if PRAGMA_IMPORT
#pragma import on
#endif
#if PRAGMA_STRUCT_ALIGN
#pragma options align=mac68k
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(push, 2)
#elif PRAGMA_STRUCT_PACK
#pragma pack(2)
#endif
/**************************************************************************
Types and Constants
**************************************************************************/
/*
The specific type for the AppleScript instance of the
Open Scripting Architecture type.
*/
enum {
typeAppleScript = FOUR_CHAR_CODE('ascr'),
kAppleScriptSubtype = typeAppleScript,
typeASStorage = typeAppleScript
};
/**************************************************************************
Component Selectors
**************************************************************************/
enum {
kASSelectInit = 0x1001,
kASSelectSetSourceStyles = 0x1002,
kASSelectGetSourceStyles = 0x1003,
kASSelectGetSourceStyleNames = 0x1004
};
/**************************************************************************
OSAGetScriptInfo Selectors
**************************************************************************/
enum {
kASHasOpenHandler = FOUR_CHAR_CODE('hsod')
};
/*
This selector is used to query a context as to whether it contains
a handler for the kAEOpenDocuments event. This allows "applets" to be
distinguished from "droplets." OSAGetScriptInfo returns false if
there is no kAEOpenDocuments handler, and returns the error value
errOSAInvalidAccess if the input is not a context.
*/
/**************************************************************************
Initialization
**************************************************************************/
/*
* ASInit()
*
* Availability:
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API( OSAError )
ASInit(
ComponentInstance scriptingComponent,
long modeFlags,
long minStackSize,
long preferredStackSize,
long maxStackSize,
long minHeapSize,
long preferredHeapSize,
long maxHeapSize) FIVEWORDINLINE(0x2F3C, 0x001C, 0x1001, 0x7000, 0xA82A);
/*
ComponentCallNow(kASSelectInit, 28);
This call can be used to explicitly initialize AppleScript. If it is
not called, the a scripting size resource is looked for and used. If
there is no scripting size resource, then the constants listed below
are used. If at any stage (the init call, the size resource, the
defaults) any of these parameters are zero, then parameters from the
next stage are used. ModeFlags are not currently used.
Errors:
errOSASystemError initialization failed
*/
/*
These values will be used if ASInit is not called explicitly, or if any
of ASInit's parameters are zero:
*/
enum {
kASDefaultMinStackSize = 4 * 1024,
kASDefaultPreferredStackSize = 16 * 1024,
kASDefaultMaxStackSize = 16 * 1024,
kASDefaultMinHeapSize = 4 * 1024,
kASDefaultPreferredHeapSize = 16 * 1024,
kASDefaultMaxHeapSize = 32L * 1024 * 1024
};
/**************************************************************************
Source Styles
**************************************************************************/
/*
* ASSetSourceStyles()
*
* Availability:
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API( OSAError )
ASSetSourceStyles(
ComponentInstance scriptingComponent,
STHandle sourceStyles) FIVEWORDINLINE(0x2F3C, 0x0004, 0x1002, 0x7000, 0xA82A);
/*
ComponentCallNow(kASSelectSetSourceStyles, 4);
Errors:
errOSASystemError operation failed
*/
/*
* ASGetSourceStyles()
*
* Availability:
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API( OSAError )
ASGetSourceStyles(
ComponentInstance scriptingComponent,
STHandle * resultingSourceStyles) FIVEWORDINLINE(0x2F3C, 0x0004, 0x1003, 0x7000, 0xA82A);
/*
ComponentCallNow(kASSelectGetSourceStyles, 4);
Errors:
errOSASystemError operation failed
*/
/*
* ASGetSourceStyleNames()
*
* Availability:
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
* CarbonLib: in CarbonLib 1.0 and later
* Mac OS X: in version 10.0 or later
*/
EXTERN_API( OSAError )
ASGetSourceStyleNames(
ComponentInstance scriptingComponent,
long modeFlags,
AEDescList * resultingSourceStyleNamesList) FIVEWORDINLINE(0x2F3C, 0x0008, 0x1004, 0x7000, 0xA82A);
/*
ComponentCallNow(kASSelectGetSourceStyleNames, 8);
This call returns an AEList of styled text descriptors the names of the
source styles in the current dialect. The order of the names corresponds
to the order of the source style constants, below. The style of each
name is the same as the styles returned by ASGetSourceStyles.
Errors:
errOSASystemError operation failed
*/
/*
Elements of STHandle correspond to following categories of tokens, and
accessed through following index constants:
*/
enum {
kASSourceStyleUncompiledText = 0,
kASSourceStyleNormalText = 1,
kASSourceStyleLanguageKeyword = 2,
kASSourceStyleApplicationKeyword = 3,
kASSourceStyleComment = 4,
kASSourceStyleLiteral = 5,
kASSourceStyleUserSymbol = 6,
kASSourceStyleObjectSpecifier = 7,
kASNumberOfSourceStyles = 8
};
#if PRAGMA_STRUCT_ALIGN
#pragma options align=reset
#elif PRAGMA_STRUCT_PACKPUSH
#pragma pack(pop)
#elif PRAGMA_STRUCT_PACK
#pragma pack()
#endif
#ifdef PRAGMA_IMPORT_OFF
#pragma import off
#elif PRAGMA_IMPORT
#pragma import reset
#endif
#ifdef __cplusplus
}
#endif
#endif /* __APPLESCRIPT__ */