-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKFAppleScriptHandlerAdditionsCore.h
57 lines (46 loc) · 2.04 KB
/
KFAppleScriptHandlerAdditionsCore.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
//
// KFAppleScriptHandlerAdditionsCore.h
// KFAppleScriptHandlerAdditions v. 2.3, 12/31, 2004
//
// Copyright (c) 2003-2004 Ken Ferry. Some rights reserved.
// http://homepage.mac.com/kenferry/software.html
//
// This work is licensed under a Creative Commons license:
// http://creativecommons.org/licenses/by-nc/1.0/
//
// Send me an email if you have any problems (after you've read what there is to read).
#import <Foundation/Foundation.h>
// Name of exception thrown by execute methods below.
// -[exception userInfo] will retrieve the error dictionary
// from -[NSAppleScript executeAppleEvent:error:]. See the NSAppleScript docs
// for how to use that dictionary.
extern NSString *KFASException;
@interface NSAppleScript (KFAppleScriptHandlerAdditions)
// These four methods make up the recommended API.
// The arguments and returns are standard objective-c objects, not
// (necessarily) apple event descriptors.
//
// They raise KFASException on AppleScript errors, as described above.
- (id)executeHandler:(NSString *)handlerName;
// raises NSInvalidArgumentException on parameter nil
- (id)executeHandler:(NSString *)handlerName
withParameter:(id)arg;
- (id)executeHandler:(NSString *)handlerName
withParameters:(id)firstArg, ...;
- (id)executeHandler:(NSString *)handlerName
withParametersFromArray:(NSArray *)argumentsArray;
// Methods below are for compatibility with KFAppleScriptHandlerAdditions 2.0.
// I'd recommend using the new versions if you're starting a new project.
// The new versions throw exceptions instead of using an error dictionary.
- (id)executeHandler:(NSString *)handlerName
error:(NSDictionary **)errorInfo;
- (id)executeHandler:(NSString *)handlerName
error:(NSDictionary **)errorInfo
withParameter:(id)arg;
- (id)executeHandler:(NSString *)handlerName
error:(NSDictionary **)errorInfo
withParameters:(id)firstArg, ...;
- (id)executeHandler:(NSString *)handlerName
error:(NSDictionary **)errorInfo
withParametersFromArray:(NSArray *)argumentsArray;
@end