SBApplication.h
1 #import <Foundation/Foundation.h> 2 #import <CoreServices/CoreServices.h> 3 #import <ScriptingBridge/SBObject.h> 4 5 NS_ASSUME_NONNULL_BEGIN 6 7 @protocol SBApplicationDelegate; 8 9 NS_CLASS_AVAILABLE(10_5, NA) 10 @interface SBApplication : SBObject <NSCoding> 11 12 - (nullable __kindof SBApplication *) initWithBundleIdentifier:(NSString *)ident; 13 - (nullable __kindof SBApplication *) initWithURL:(NSURL *)url; 14 - (nullable __kindof SBApplication *) initWithProcessIdentifier:(pid_t)pid; 15 16 + (nullable __kindof SBApplication *) applicationWithBundleIdentifier:(NSString *) ident; 17 + (nullable __kindof SBApplication *) applicationWithURL:(NSURL *) url; 18 + (nullable __kindof SBApplication *) applicationWithProcessIdentifier:(pid_t) pid; 19 20 - (nullable Class) classForScriptingClass:(NSString *) className; 21 22 @property (readonly, getter=isRunning) BOOL running; 23 24 - (void) activate; 25 26 @property (nullable, strong) id <SBApplicationDelegate> delegate; 27 28 @property LSLaunchFlags launchFlags; 29 30 @property AESendMode sendMode; 31 32 @property long timeout; 33 34 @end 35 36 @protocol SBApplicationDelegate 37 38 - (nullable id) eventDidFail:(const AppleEvent *)event withError:(NSError *)error; 39 40 @end 41 42 NS_ASSUME_NONNULL_END