/*! @header NSAppleEventDescriptor+NDAppleScriptObject @abstract Declares the category NSAppleEventDescriptor (NDAppleScriptObject) @discussion Additional methods initially created for use with NDAppleScriptObject but could have other applications especially with Cocoa's NSAppleScript. */ #import #import /*! @category NSAppleEventDescriptor(NDAppleScriptObject) @abstract Category of NSAppleEventDescriptor. @discussion Add some methods for use with AppleScripts and AppleEvents. */ @interface NSAppleEventDescriptor (NDAppleScriptObject) /*! @method descriptorWithAEDescNoCopy: @abstract Returns a NSAppleEventDescriptor for the AEDesc. @discussion Allocates, initializes and returns an NSAppleEventDescriptor that takes ownership of the Carbon AEDesc structure pointed to by aeDesc. Returns nil if an error occurs. The initialized object takes responsibility for calling the AEDisposeDesc function on the AEDesc at object deallocation time. @param aeDesc A Carbon AEDesc structure. @result A NSAppleEventDescriptor */ + (id)descriptorWithAEDescNoCopy:(const AEDesc *)aeDesc; /*! @method descriptorWithAEDesc: @abstract Returns a NSAppleEventDescriptor for the AEDesc. @discussion Allocates, initializes and returns an NSAppleEventDescriptor that copies the Carbon AEDesc structure pointed to by aeDesc. Returns nil if an error occurs. @param aeDesc A Carbon AEDesc structure @result A NSAppleEventDescriptor */ + (id)descriptorWithAEDesc:(const AEDesc *)aeDesc; /*! @method initWithAEDesc: @abstract Intializes a NSAppleEventDescriptor with a AEDesc. @discussion Initializes and returns an NSAppleEventDescriptor that copies the Carbon AEDesc structure pointed to by aeDesc. Returns nil if an error occurs. @param aeDesc A Carbon AEDesc structure @result A NSAppleEventDescriptor */ - (id)initWithAEDesc:(const AEDesc *)aeDesc; /*! @method isTargetCurrentProcess @abstract Determines if target is current process. @discussion If the recevier is a AppleEvent that contains a target ProcessSerialNumber that is the current process (ie you application) then this method returns YES. @result Returns YES if the recevier is an AppleEvent for the current process. */ - (BOOL)isTargetCurrentProcess; /*! @method getAEDesc: @abstract Get the receviers AEDesc. @discussion Copies the receviers AEDesc to the supplied AEDesc. @param aeDescPtr The address of an empty AEDesc. @result Returns YES if successful. */ - (BOOL)getAEDesc:(AEDesc *)aeDescPtr; @end /*! @category NSAppleEventDescriptor(NDConversion) @abstract Category of NSAppleEventDescriptor. @discussion

Adds methods for converting between AppleEvent types and Objective-C types.

The following type conversions are supported in 'either direction' or 'both directions';

Objective-C Type Descriptor Type
nil typeNull
NSNumber<BOOL> typeBoolean
NSNumber<short int>
NSNumber<char>
typeSInt16
typeShortInteger
typeSMInt
NSNumber<int>
NSNumber<long int>
typeSInt32
typeLongInteger
typeInteger
NSNumber<float> typeIEEE32BitFloatingPoint
typeShortFloat
typeSMFloat
NSNumber<double> typeIEEE64BitFloatingPoint
typeFloat
typeLongFloat
NSNumber<long double> type128BitFloatingPoint
NSNumber<unsigned char>
NSNumber<unsigned short int>
NSNumber<unsigned int>
NSNumber<unsigned long int>
typeUInt32
NSNumber<unsigned long long>
NSNumber<long long>
no 64 bit unsigned
typeSInt64
NSValue<NSRange> typeOSAErrorRange
NSString typeText
kTXNUnicodeTextData
typeAlias

see aliasListDescriptorWithArray: and aliasDescriptorWithString:
NSArray typeAEList
typeAEList<typeAlias>

see aliasListDescriptorWithArray:
NSDictionary typeAERecord
see descriptorWithDictionary:
typeAEList
see userRecordDescriptorWithDictionary:
NSURL typeAlias
typeFileURL
NDAppleScriptObject cScript
short int typeShortInteger
int typeInteger
unsigned int
typeMagnitude
long int typeLongInteger
float typeShortFloat
double typeLongFloat
BOOL typeBoolean
typeTrue
typeFalse
char* typeText
id* typeAEList
typeAERecord
va_list typeAEList
typeAERecord

*/ @interface NSAppleEventDescriptor (NDConversion) /*! @method currentProcessDescriptor @abstract Returns a NSAppleEventDescriptor for the current process. @discussion Returns a AppleEvent descriptor for the current process, ProcessSerialNumber { 0, kCurrentProcess } @result A NSAppleEventDescriptor. */ + (NSAppleEventDescriptor *)currentProcessDescriptor; /*! @method targetProcessSerialNumber @abstract Returns the receviers target ProcessSerialNumber. @discussion If the recevier is a AppleEvent that contains a target ProcessSerialNumber, then this method will return it otherwise the result undefined. @result The target ProcessSerialNumber. */ - (ProcessSerialNumber)targetProcessSerialNumber; /*! @method targetCreator @abstract Returns the receviers target Creator. @discussion If the recevier is a AppleEvent that contains a target Creator, then this method will return it otherwise the result value is garbage. @result The target type creator. */ - (OSType)targetCreator; /*! @method aliasListDescriptorWithArray: @abstract Returns an list descriptor of alias descriptors. @discussion Takes a NSArray or file url NSURLs and/or path NSStrings and returns a list descriptor of alias descriptors for all of the files. @param array A NSArray of file url NSURLs and/or path NSStrings. @result A NSAppleEventDescriptor containing a list descriptor of alias descriptors. */ + (NSAppleEventDescriptor *)aliasListDescriptorWithArray:(NSArray *)array; /*! @method descriptorWithURL: @abstract Returns a url descriptor. @discussion Returns a new url descriptor from the supplied NSURL. @param URL A NSURL object. @result A NSAppleEventDescriptor containing a url descriptor. */ + (id)descriptorWithURL:(NSURL *)URL; /*! @method aliasDescriptorWithURL: @abstract Returns a alias descriptor. @discussion Returns a new alias descriptor from the supplied file url NSURL. @param URL A file url NSURL object. @result A NSAppleEventDescriptor containing a alias descriptor. */ + (NSAppleEventDescriptor *)aliasDescriptorWithURL:(NSURL *)URL; /*! @method aliasDescriptorWithString: @abstract Returns a alias descriptor. @discussion Returns a new alias descriptor from the supplied pathNSString. @param path A file path. @result A NSAppleEventDescriptor containing a alias descriptor. */ + (NSAppleEventDescriptor *)aliasDescriptorWithString:(NSString *)path; /*! @method aliasDescriptorWithFile: @abstract Returns a alias descriptor. @discussion Returns a new alias descriptor from the supplied object which can be either a path NSString or a NSURL. @param aFile A file object of type NSString or NSURL. @result A NSAppleEventDescriptor containing a alias descriptor. */ + (NSAppleEventDescriptor *)aliasDescriptorWithFile:(id)aFile; /*! @method descriptorWithTrueBoolean @abstract Returns a NSAppleEventDescriptor containing a true boolean descriptor. @discussion Returns a NSAppleEventDescriptortypeTrue @result A NSAppleEventDescriptor containing a true boolean descriptor. */ + (id)descriptorWithTrueBoolean; /*! @method descriptorWithFalseBoolean @abstract Returns a NSAppleEventDescriptor containing a false boolean descriptor. @discussion Returns a NSAppleEventDescriptortypeFalse @result A NSAppleEventDescriptor containing a false boolean descriptor. */ + (id)descriptorWithFalseBoolean; /*! @method descriptorWithShort: @abstract Returns a NSAppleEventDescriptor containing a short integer descriptor. @discussion Returns a NSAppleEventDescriptortypeShortInteger @param value The short int. @result A NSAppleEventDescriptor containing a short integer descriptor. */ + (id)descriptorWithShort:(short int)value; /*! @method descriptorWithLong: @abstract Returns a NSAppleEventDescriptor containing a long integer descriptor. @discussion Returns a NSAppleEventDescriptortypeLongInteger @param value The long int. @result A NSAppleEventDescriptor containing a lon integer descriptor. */ + (id)descriptorWithLong:(long int)value; /*! @method descriptorWithInt: @abstract Returns a NSAppleEventDescriptor containing a integer descriptor. @discussion Returns a NSAppleEventDescriptor containing a descriptor of type typeInteger @param value The int. @result A NSAppleEventDescriptor containing a int descriptor. */ + (id)descriptorWithInt:(int)value; /*! @method descriptorWithFloat: @abstract Returns a NSAppleEventDescriptor containing a float descriptor. @discussion Returns a NSAppleEventDescriptor containing a descriptor of type typeShortFloat @param value The float. @result A NSAppleEventDescriptor containing a float descriptor. */ + (id)descriptorWithFloat:(float)value; /*! @method descriptorWithDouble: @abstract Returns a NSAppleEventDescriptor containing a double descriptor. @discussion Returns a NSAppleEventDescriptor containing a descriptor of type typeLongFloat @param value The double. @result A NSAppleEventDescriptor containing a double descriptor. */ + (id)descriptorWithDouble:(double)value; /*! @method descriptorWithUnsignedInt: @abstract Returns a NSAppleEventDescriptor containing a unsigned integer descriptor. @discussion Returns a NSAppleEventDescriptor containing a descriptor of type typeMagnitude @param value The unsigned int. @result A NSAppleEventDescriptor containing a unsigned integer descriptor. */ + (id)descriptorWithUnsignedInt:(unsigned int)value; /*! @method descriptorWithCString: @abstract Returns a NSAppleEventDescriptor containing a string the c string.. @discussion Returns a NSAppleEventDescriptor containing a descriptor of type typeText or typeChar @param aString A c string. @result A NSAppleEventDescriptor containing plain text. */ + (id)descriptorWithCString:(const char *)aString; /*! @method descriptorWithNumber: @abstract Returns a NSAppleEventDescriptor containing a number descriptor. @discussion Returns a NSAppleEventDescriptor containing a descriptor for the value contained within number. The value is determined by object-C type returned frome the method -[NSNumber objCType] with the following mappings;
Objective-C TypeDescriptor Type
floattypeIEEE32BitFloatingPoint
doubletypeIEEE64BitFloatingPoint
long doubletype128BitFloatingPoint
unsigned chartypeUInt32
chartypeSInt16
unsigned short inttypeUInt32
short inttypeSInt16
unsigned inttypeUInt32
inttypeSInt32
unsigned long inttypeUInt32
long inttypeSInt32
unsigned long longtypeSInt64
long longtypeSInt64
BOOLtypeBoolean
@param number The NSNumber. @result A NSAppleEventDescriptor containing a number. */ + (id)descriptorWithNumber:(NSNumber *)number; /*! @method descriptorWithValue: @abstract Returns a NSAppleEventDescriptor containing a value descriptor. @discussion Returns a NSAppleEventDescriptor containing a descriptor for the value contained within value. The value is determined by object-C type returned frome the method -[NSValue objCType] with the following mappings;
Objective-C TypeDescriptor Type
NSRangetypeRangeDescriptor
@param value The NSValue @result A NSAppleEventDescriptor containing a value. */ + (id)descriptorWithValue:(NSValue *)value; /*! @method descriptorWithObject: @abstract Returns a NSAppleEventDescriptor. @discussion

descriptorWithObject: will return the best descriptor for the given the object using one of the other -[NSAppleEventDescriptor descriptorWithXXXX:] methods. descriptorWithObject: works recursivly so if object is of type NSArray or NSDictionary then the objects contained within object will also be converted to descriptors using the this method.

The following type classes are supported;

Objective-C Class Descriptor Type
nil typeNull
NSNumber<BOOL> typeBoolean
NSNumber<short int>
NSNumber<char>
typeSInt16
typeShortInteger
typeSMInt
NSNumber<int>
NSNumber<long int>
typeSInt32
typeLongInteger
typeInteger
NSNumber<float> typeIEEE32BitFloatingPoint
typeShortFloat
typeSMFloat
NSNumber<double> typeIEEE64BitFloatingPoint
typeFloat
typeLongFloat
NSNumber<long double> type128BitFloatingPoint
NSNumber<unsigned char>
NSNumber<unsigned short int>
NSNumber<unsigned int>
NSNumber<unsigned long int>
typeUInt32
NSNumber<unsigned long long>
NSNumber<long long>
no 64 bit unsigned
typeSInt64
NSValue<NSRange> typeOSAErrorRange
NSString typeText
kTXNUnicodeTextData
NSArray typeAEList
NSDictionary typeAERecord
NSURL typeAlias
NSAppleEventDescriptor [object typeCodeValue]
returns object unmodified
NDAppleScriptObject cScript

@param object An object that can be converted into a descriptor. @result A NSAppleEventDescriptor. */ + (id)descriptorWithObject:(id)object; /*! @method descriptorWithArray: @abstract Returns a list descriptor. @discussion descriptorWithArray: returns a list decriptor containing AppleEvent decriptors returned from the method descriptorWithObject: when passed each of array's objects. @param array The array to create a NSAppleEventDescriptor from. @result A NSAppleEventDescriptor for a list descriptor. */ + (id)descriptorWithArray:(NSArray *)array; /*! @method listDescriptorWithObjects:... @abstract Returns a list descriptor. @discussion descriptorWithArray: returns a list decriptor containing AppleEvent decriptors returned from the method descriptorWithObject: when passed each of object arguments. @param firstObject The argument list terminated with nil. @result A NSAppleEventDescriptor for a list descriptor. */ + (id)listDescriptorWithObjects:(id)firstObject, ...; /*! @method listDescriptorWithObjects:arguments: @abstract Returns a list descriptor. @discussion descriptorWithArray: returns a list decriptor containing AppleEvent decriptors returned from the method descriptorWithObject: when passed each of object arguments. @param firstObject The first object of the argument list. @param argList The argument list. @result A NSAppleEventDescriptor for a list descriptor. */ + (id)listDescriptorWithObjects:(id)object arguments:(va_list)argList; /*! @method recordDescriptorWithObjects:keywords:count: @abstract Returns a record descriptor @discussion Returns a record descriptor with the supplied object and keys. The objects are converted into NSAppleEventDescriptor with the method descriptorWithObject:. @param objects A pointer to an array of objects. @param keywords A pointer to an array of keywords @param count The number of objects and keywords. @result A NSAppleEventDescriptor for a record descriptor. */ + (NSAppleEventDescriptor *)recordDescriptorWithObjects:(id *)objects keywords:(AEKeyword *)keywords count:(unsigned int)count; /*! @method recordDescriptorWithDictionary: @abstract Returns a record descriptor @discussion The dictionary keys must be NSNumber, preferable NSNumber<unsigned long int>, representing AEKeyword. The values are converted to NSAppleEventDescriptor's with the method descriptorWithObject:. If you are after a record as typically used in apple scripts then see the method descriptorWithDictionary: @param dictionary A dictionary where the keys are all NSNumber<unsigned long int> @result A NSAppleEventDescriptor for a record descriptor. */ + (NSAppleEventDescriptor *)recordDescriptorWithDictionary:(NSDictionary *)dictionary; /*! @method descriptorWithDictionary: @abstract Returns a record descriptor @discussion Returns a record descriptor with one key value pair where the keyword is keyASUserRecordFields and the value is descriptor of the type typeAEList as returned from the method userRecordDescriptorWithDictionary:. This is how record types in AppleScript are represented using AppleEvents @param aDictionary A dictionary where the key can be represented as case insensitive strings. @result A NSAppleEventDescriptor for a record descriptor. */ + (id)descriptorWithDictionary:(NSDictionary *)aDictionary; /*! @method descriptorWithObjectAndKeys:... @abstract Returns a record descriptor @discussion Returns a record descriptor with one key value pair where the keyword is keyASUserRecordFields and the value is descriptor of the type typeAEList as returned from the method userRecordDescriptorWithObjectAndKeys:arguments:. This is how record types in AppleScript are represented using AppleEvents @param object The first object is a list of object/key pairs terminated with nil. @result A NSAppleEventDescriptor for a record descriptor. */ + (id)descriptorWithObjectAndKeys:(id)object, ...; /*! @method descriptorWithObjectAndKeys:arguments: @abstract Returns a record descriptor @discussion Returns a record descriptor with one key value pair where the keyword is keyASUserRecordFields and the value is descriptor of the type typeAEList as returned from the method userRecordDescriptorWithObjectAndKeys:arguments:. This is how record types in AppleScript are represented using AppleEvents @param object The first object is a list of object/key pairs. @param argList The argument list. @result A NSAppleEventDescriptor for a record descriptor. */ + (id)descriptorWithObjectAndKeys:(id)object arguments:(va_list)argList; /*! @method userRecordDescriptorWithObjectAndKeys:... @abstract Returns a user record. @discussion Create a list descriptor that can be used as the value for the key keyASUserRecordFields in record descriptors of AppleEvents representing AppleScript subroutine calls, this is how records in AppleScripts represented. The resulting descriptor is identical to the descriptor returned from the method listDescriptorWithObjects:... if the keys and object are swap around and all of the keys are of type NSString. userRecordDescriptorWithObjectAndKeys:... has the advantage over listDescriptorWithObjects:... in that the keys are converted to NSString using the method -[NSObject description]. @param object A list of object and keys terminated with a nil. @result A NSAppleEventDescriptor for a list descriptor representing a user record. */ + (id)userRecordDescriptorWithObjectAndKeys:(id)object, ...; /*! @method userRecordDescriptorWithObjectAndKeys:arguments: @abstract Returns a user record. @discussion Create a list descriptor that can be used as the value for the key keyASUserRecordFields in record descriptors of AppleEvents representing AppleScript subroutine calls, this is how records in AppleScripts represented. The objects are converted to NSAppleEventDescriptor using the method descriptorWithObject:. @param object The first object in a list of objects and keys. @param argList The arguments list. @result A NSAppleEventDescriptor for a list descriptor representing a user record. */ + (NSAppleEventDescriptor *)userRecordDescriptorWithObjectAndKeys:(id)object arguments:(va_list)argList; /*! @method userRecordDescriptorWithObjects:keys:count: @abstract Returns a user record. @discussion Create a list descriptor that can be used as the value for the key keyASUserRecordFields in record descriptors of AppleEvents representing AppleScript subroutine calls, this is how records in AppleScripts represented. The objects are converted to NSAppleEventDescriptor using the method descriptorWithObject:. @param objects A pointer to an array of objects. @param keys A pointer to an array of NSStrings representing keys. @param count The number of objects and keys. @result A NSAppleEventDescriptor for a list descriptor representing a user record. */ + (NSAppleEventDescriptor *)userRecordDescriptorWithObjects:(id *)objects keys:(NSString **)keys count:(unsigned int)count; /*! @method userRecordDescriptorWithDictionary: @abstract Returns a user record descriptor. @discussion Create a list descriptor that can be used as the value for the key keyASUserRecordFields in record descriptors of AppleEvents representing AppleScript subroutine calls, this is how records in AppleScripts represented. The objects are converted to NSAppleEventDescriptor using the method descriptorWithObject:. @param dictionary A dictionay where the keys are all NSStrings @result A NSAppleEventDescriptor for a list descriptor representing a user record. */ + (NSAppleEventDescriptor *)userRecordDescriptorWithDictionary:(NSDictionary *)dictionary; /*! @method arrayValue @abstract Returns an NSArray for a list descriptor. @discussion Returns a NSArray if the receviers contains list descriptor with each element convert to an appropriate object as determined by the method -[NSAppleEventDescriptor objectValue]. If the recevier does not contain a list descriptor then an NSArray filled with garbage is returned. @result A NSArray. */ - (NSArray *)arrayValue; /*! @method dictionaryValueFromRecordDescriptor @abstract Returns an NSDictionary for a record descriptor. @discussion Returns a NSDictionary if the receviers is a record descriptor with each element convert to an appropriate object as determined by the method -[NSAppleEventDescriptor objectValue] and the key converted to a NSNumbers. If the recevier does not contain a record descriptor then the resut is undefined. @result A NSDictionary. */ - (NSDictionary *)dictionaryValueFromRecordDescriptor; /*! @method dictionaryValue @abstract Returns an NSDictionary for a record descriptor. @discussion Returns a NSDictionary if the receviers is a record descriptor with a list value for the key keyASUserRecordFields, this is how records from AppleScripts are represented. Each even numbered element of the list is converted in to an appropriate object as determined by the method -[NSAppleEventDescriptor objectValue] and each odd numbered element is used as the key and converted to a NSString. If the recevier is not a record descriptor that contains a list value for the key keyASUserRecordFields then the resut is undefined. @result A NSDictionary with keys all of type NSString */ - (NSDictionary *)dictionaryValue; /*! @method urlValue @abstract Returns a NSURL for the recevier.. @discussion Returns a file url NSURL for an alias descriptor. If the recevier does not contain an alias descriptor the nil is returned. Currently url descriptors are not handled. @result A NSURL. */ - (NSURL *)urlValue; /*! @method unsignedIntValue @abstract Returns a unsigned int value for the recevier. @discussion Returns a unsigned int value if the recevier contains a unsigned integer descriptor, otherwise it returns 0. @result An unsigned int value. */ - (unsigned int)unsignedIntValue; /*! @method floatValue @abstract Returns a float value for the recevier. @discussion Returns a float value if the recevier contains a float descriptor, otherwise it returns 0. @result An float value. */ - (float)floatValue; /*! @method doubleValue @abstract Returns a double value for the recevier. @discussion Returns a double value if the recevier contains a double descriptor, otherwise it returns 0. @result An double value. */ - (double)doubleValue; /*! @method value @abstract Returns a NSValue object for the recevier. @discussion Returns a NSValue object for the recevier if it contains a any value or number type descriptor, otherwise it returns nil. For most values value is identical to numberValue. @result An NSValue object. */ - (NSValue *)value; /*! @method numberValue @abstract Returns a NSNumber object for the recevier. @discussion Returns a NSNumber object for the recevier if it contains a any number type descriptor, otherwise it returns nil. @result An NSNumber object. */ - (NSNumber *)numberValue; /*! @method objectValue @abstract Returns a object for the recevier. @discussion

Returns a subclass of NSObject by determining the type of the receviers descriptor and converting it into the appropriate instance of a Objective-C class.

Descriptor types are mapped to classes in the following ways.

Descriptor TypeObjective-C Class
typeNull NSNull
typeBoolean
typeShortInteger
typeSMInt
typeLongInteger
typeInteger
typeIEEE32BitFloatingPoint
typeShortFloat
typeSMFloat
typeIEEE64BitFloatingPoint
typeFloat
typeLongFloat
typeExtended
typeComp
typeMagnitude
typeTrue
typeFalse
NSNumber
typeChar NSString
typeAEList NSArray
typeAERecord NSDictionary
typeAlias
typeFileURL
NSULR
cScript NDAppleScriptObject if available.
NSAppleEventDescriptor otherwise.
cEventIdentifier NSNumber
All Other Types NSAppleEventDescriptor

@result A subclass of NSObject */ - (id)objectValue; @end /*! @category NSAppleEventDescriptor(NDCompleteEvents) @abstract Category of NSAppleEventDescriptor. @discussion Adds methods for creating complete AppleEvents. */ @interface NSAppleEventDescriptor (NDCompleteEvents) /*! @method openEventDescriptorWithTargetDescriptor: @abstract Get a NSAppleEventDescriptor for an open event. @discussion Creates a NSAppleEventDescriptor for an open application event, kAEOpenApplication. @param targetDescriptor an NSAppleEventDescriptor that identifies the target application for the Apple event. @result A NSAppleEventDescriptor containing an open application event descriptor. */ + (NSAppleEventDescriptor *)openEventDescriptorWithTargetDescriptor:(NSAppleEventDescriptor *)targetDescriptor; /*! @method openEventDescriptorWithTargetDescriptor:array: @abstract Get a NSAppleEventDescriptor for an open event. @discussion Creates a NSAppleEventDescriptor for an open document event, kAEOpenDocuments. The objects within array have to be NSString paths or file NSULRs, which are converted into typeAlias. @param targetDescriptor an NSAppleEventDescriptor that identifies the target application for the Apple event. @param array A NSArray of file url NSURLs and/or path NSStrings. @result A NSAppleEventDescriptor containing an open application event or an open documents event descriptor. */ + (NSAppleEventDescriptor *)openEventDescriptorWithTargetDescriptor:(NSAppleEventDescriptor *)targetDescriptor array:(NSArray *)array; /*! @method quitEventDescriptorWithTargetDescriptor: @abstract Get a NSAppleEventDescriptor for a quit event. @discussion Creates a NSAppleEventDescriptor for an quit event, kAEQuitApplication. @param targetDescriptor an NSAppleEventDescriptor that identifies the target application for the Apple event. @result A NSAppleEventDescriptor containing a quit event descriptor. */ + (NSAppleEventDescriptor *)quitEventDescriptorWithTargetDescriptor:(NSAppleEventDescriptor *)targetDescriptor; /*! @method descriptorWithSubroutineName:argumentsListDescriptor: @abstract Returns a NSAppleEventDescriptor for calling AppleScript routines. @discussion AppleScript routines can be called by name, descriptorWithSubroutineName:argumentsDescriptor: returns a NSAppleEventDescriptor to do so. The routineName is the name of the routine to be called, AppleScript routines are case insensitive, routineName is converted to all lower case. @param routineName The rountine name to be called. @param param The parameters descriptors. @result A NSAppleEventDescriptor */ + (id)descriptorWithSubroutineName:(NSString *)routineName argumentsListDescriptor:(NSAppleEventDescriptor *)param; /*! @method descriptorWithSubroutineName:argumentsArray: @abstract Returns a NSAppleEventDescriptor for calling an AppleScript subroutine with positional arguments. @discussion descriptorWithSubroutineName:argumentsDescriptor: returns a NSAppleEventDescriptor to call a AppleScript subroutine with positional arguments. AppleScript routines are case insensitive so routineName is converted to all lower case. @param routineName The rountine name to be called. @param paramArray A NSArray of Objective-C class that are converted into NSAppleEventDescriptor using the function descriptorWithObject:. @result A NSAppleEventDescriptor for a subroutine with positional arguments. */ + (id)descriptorWithSubroutineName:(NSString *)routineName argumentsArray:(NSArray *)paramArray; /*! @method descriptorWithSubroutineName:arguments:... @abstract Returns a NSAppleEventDescriptor for calling an AppleScript subroutine with positional arguments. @discussion descriptorWithSubroutineName:arguments: returns a NSAppleEventDescriptor to call a AppleScript subroutine with positional arguments. AppleScript routines are case insensitive so routineName is converted to all lower case. @param routineName The rountine name to be called. @param firstArg The first object of a nil terminated list of objects that are converted into NSAppleEventDescriptor using the function descriptorWithObject:. @result A NSAppleEventDescriptor for a subroutine with positional arguments. */ + (id)descriptorWithSubroutineName:(NSString *)routineName arguments:(id)firstArg, ...; /*! @method descriptorWithSubroutineName:labels:argumentObjects:count: @abstract Returns a NSAppleEventDescriptor for calling an AppleScript routine with labeled arguments. @discussion

descriptorWithSubroutineName:argumentsDescriptor: returns a NSAppleEventDescriptor to call a AppleScript subroutine with labeled arguments. AppleScript routines are case insensitive so routineName is converted to all lower case. paramArray is an array of objective-C types that are converted into NSAppleEventDescriptor using the function descriptorWithObject:.

The possible keywords are;

Key WordAppleScript key word
keyASPrepositionAboutabout
keyASPrepositionAboveabove
keyASPrepositionAgainstagainst
keyASPrepositionApartFromapart from
keyASPrepositionAroundaround
keyASPrepositionAsideFromaside from
keyASPrepositionAtat
keyASPrepositionBelowbelow
keyASPrepositionBeneathbeneath
keyASPrepositionBesidebeside
keyASPrepositionBetweenbetween
keyASPrepositionByby
keyASPrepositionForfor
keyASPrepositionFromfrom
keyASPrepositionGivengiven
keyASPrepositionInin
keyASPrepositionInsteadOfinstead of
keyASPrepositionIntointo
keyASPrepositionOnon
keyASPrepositionOntoonto
keyASPrepositionOutOfout of
keyASPrepositionOverover
keyASPrepositionSincesince
keyASPrepositionThroughthrough
keyASPrepositionThruthru
keyASPrepositionToto
keyASPrepositionUnderunder
keyASPrepositionUntiluntil
keyASPrepositionWithwith
keyASPrepositionWithoutwithout
keyASUserRecordFieldskey for a list descriptor of user record fields

To find out the rules for use of the key words see the AppleScript language documentation.

@param routineName The rountine name to be called. @param labels A c array of keywords @param objects A c array of Objective-C class that are converted into NSAppleEventDescriptor using the function descriptorWithObject:. @param count The number of labels and objects @result A NSAppleEventDescriptor for a subroutine with labled arguments. */ + (id)descriptorWithSubroutineName:(NSString *)routineName labels:(AEKeyword*)labels argumentObjects:(id *)objects count:(unsigned int)count; /*! @method descriptorWithSubroutineName:labels:argumentDescriptors:count: @abstract Returns a NSAppleEventDescriptor for calling an AppleScript routine with labeled arguments. @discussion

descriptorWithSubroutineName:labels:argumentDescriptors:count: returns a NSAppleEventDescriptor to call a AppleScript subroutine with labeled arguments. AppleScript routines are case insensitive so routineName is converted to all lower case. If keyASUserRecordFields is used as a keyword then the NSAppleEventDescriptor should be a list descriptor alternating between keys and parameter begining with a key, as returned from one of the userRecordDescriptorWith... methods.

The possible keywords are;

Key WordAppleScript key word
keyASPrepositionAboutabout
keyASPrepositionAboveabove
keyASPrepositionAgainstagainst
keyASPrepositionApartFromapart from
keyASPrepositionAroundaround
keyASPrepositionAsideFromaside from
keyASPrepositionAtat
keyASPrepositionBelowbelow
keyASPrepositionBeneathbeneath
keyASPrepositionBesidebeside
keyASPrepositionBetweenbetween
keyASPrepositionByby
keyASPrepositionForfor
keyASPrepositionFromfrom
keyASPrepositionGivengiven
keyASPrepositionInin
keyASPrepositionInsteadOfinstead of
keyASPrepositionIntointo
keyASPrepositionOnon
keyASPrepositionOntoonto
keyASPrepositionOutOfout of
keyASPrepositionOverover
keyASPrepositionSincesince
keyASPrepositionThroughthrough
keyASPrepositionThruthru
keyASPrepositionToto
keyASPrepositionUnderunder
keyASPrepositionUntiluntil
keyASPrepositionWithwith
keyASPrepositionWithoutwithout
keyASUserRecordFieldskey for a list descriptor of user record fields

To find out the rules for use of the key words see the AppleScript language documentation. @param routineName The rountine name to be called. @param labels A c array of keyword labels. @param params A c array of NSAppleEventDescriptor for the parameters. @param count The number of keywords and parameters. @result A NSAppleEventDescriptor for a subroutine with labled arguments. */ + (id)descriptorWithSubroutineName:(NSString *)routineName labels:(AEKeyword*)labels argumentDescriptors:(NSAppleEventDescriptor **)params count:(unsigned int)count; /*! @method descriptorWithSubroutineName:labelsAndArguments:... @abstract Returns a NSAppleEventDescriptor for calling an AppleScript routine with labeled arguments. @discussion

descriptorWithSubroutineName:labelsAndArguments:... returns a NSAppleEventDescriptor to call a AppleScript subroutine with labeled arguments. AppleScript routines are case insensitive so routineName is converted to all lower case. If keyASPrepositionGiven is used as a keyword then the arguments following it are passed to the method userRecordDescriptorWithObjectAndKeys:. and resulting descriptor is given the key keyASUserRecordFields

For example to get a subroutine descriptor to call the AppleScript subroutine

foo for arg1 given argument:arg2 
you would do the following
theSubroutine = [NSAppleEventDescriptor descriptorWithSubroutineName:@"foo"
                		labelsAndArguments:keyASPrepositionFor, arg1,
                		keyASPrepositionGiven, arg2, @"argument", nil];
which is equivalent to
theSubroutine = [NSAppleEventDescriptor descriptorWithSubroutineName:@"foo"
                		labelsAndArguments:keyASPrepositionFor, arg1, keyASUserRecordFields,
                		[NSAppleEventDescriptor userRecordDescriptorWithObjectAndKeys:arg2, @"argument", nil],
                		(AEKeyword)0];

The possible keywords are;

Key WordAppleScript key word
keyASPrepositionAboutabout
keyASPrepositionAboveabove
keyASPrepositionAgainstagainst
keyASPrepositionApartFromapart from
keyASPrepositionAroundaround
keyASPrepositionAsideFromaside from
keyASPrepositionAtat
keyASPrepositionBelowbelow
keyASPrepositionBeneathbeneath
keyASPrepositionBesidebeside
keyASPrepositionBetweenbetween
keyASPrepositionByby
keyASPrepositionForfor
keyASPrepositionFromfrom
keyASPrepositionGivengiven
keyASPrepositionInin
keyASPrepositionInsteadOfinstead of
keyASPrepositionIntointo
keyASPrepositionOnon
keyASPrepositionOntoonto
keyASPrepositionOutOfout of
keyASPrepositionOverover
keyASPrepositionSincesince
keyASPrepositionThroughthrough
keyASPrepositionThruthru
keyASPrepositionToto
keyASPrepositionUnderunder
keyASPrepositionUntiluntil
keyASPrepositionWithwith
keyASPrepositionWithoutwithout
keyASUserRecordFieldskey for a list descriptor of user record fields

To find out the rules for use of the key words see the AppleScript language documentation.

@param routineName The subroutine name. @param keyWord The first label of a list of labels and objects terminated with a 0 keyword or a nil if the end arguments follow the keyword keyASPrepositionGiven @result A NSAppleEventDescriptor for a subroutine with labled arguments. */ + (id)descriptorWithSubroutineName:(NSString *)routineName labelsAndArguments:(AEKeyword)keyWord, ...; /*! @method initWithSubroutineName:argumentsDescriptor: @abstract Initialises a NSAppleEventDescriptor for calling AppleScript routines. @discussion AppleScript routines can be called by name, initWithSubroutineName:argumentsDescriptor: returns a NSAppleEventDescriptor to do so. The routineName is the name of the routine to be called, AppleScript routines are case insensitive, routineName is converted to all lower case. @param routineName The rountine name to be called. @param param The parameters descriptors. @result A NSAppleEventDescriptor for a subroutine with positional arguments. */ - (id)initWithSubroutineName:(NSString *)routineName argumentsListDescriptor:(NSAppleEventDescriptor *)param; /*! @method initWithSubroutineName:argumentsArray: @abstract Initialises a NSAppleEventDescriptor for calling AppleScript routines. @discussion AppleScript routines can be called by name, initWithSubroutineName:argumentsDescriptor: returns a NSAppleEventDescriptor to do so. The routineName is the name of the routine to be called, AppleScript routines are case insensitive, routineName is converted to all lower case. paramArray is an array of objective-C types that can be converted into AppleScript types. @param routineName The rountine name to be called. @param paramArray The parameters. @result A NSAppleEventDescriptor for a subroutine with positional arguments. */ - (id)initWithSubroutineName:(NSString *)routineName argumentsArray:(NSArray *)paramArray; /*! @method initWithSubroutineName:labels:argumentDescriptors:count: @abstract Returns a NSAppleEventDescriptor for calling an AppleScript routine with labeled arguments. @discussion

initWithSubroutineName:labels:argumentDescriptors:count: inirializes a NSAppleEventDescriptor with a AppleScript subroutine descriptors with labeled arguments. The keyword label keyASUserRecordFields must be for a list descriptor similar to that returned from the one of the userRecordDescriptorWithXXX: methods.

The possible keywords are;

Key WordAppleScript key word
keyASPrepositionAboutabout
keyASPrepositionAboveabove
keyASPrepositionAgainstagainst
keyASPrepositionApartFromapart from
keyASPrepositionAroundaround
keyASPrepositionAsideFromaside from
keyASPrepositionAtat
keyASPrepositionBelowbelow
keyASPrepositionBeneathbeneath
keyASPrepositionBesidebeside
keyASPrepositionBetweenbetween
keyASPrepositionByby
keyASPrepositionForfor
keyASPrepositionFromfrom
keyASPrepositionGivengiven
keyASPrepositionInin
keyASPrepositionInsteadOfinstead of
keyASPrepositionIntointo
keyASPrepositionOnon
keyASPrepositionOntoonto
keyASPrepositionOutOfout of
keyASPrepositionOverover
keyASPrepositionSincesince
keyASPrepositionThroughthrough
keyASPrepositionThruthru
keyASPrepositionToto
keyASPrepositionUnderunder
keyASPrepositionUntiluntil
keyASPrepositionWithwith
keyASPrepositionWithoutwithout
keyASUserRecordFieldskey for a list descriptor of user record fields

To find out the rules for use of the key words see the AppleScript language documentation.

@param routineName The rountine name to be called. @param labels A c array of AEKeywords. @param param A c array of NSAppleEventDescriptors @param count The number of keywords and NSAppleEventDescriptors @result A NSAppleEventDescriptor for a subroutine with labeled arguments. */ - (id)initWithSubroutineName:(NSString *)routineName labels:(AEKeyword*)labels argumentDescriptors:(NSAppleEventDescriptor **)aParam count:(unsigned int)count; /*! @method initWithSubroutineName:labels:arguments:count: @abstract Returns a NSAppleEventDescriptor for calling an AppleScript routine with labeled arguments. @discussion

initWithSubroutineName:labels:arguments:count: initializes a NSAppleEventDescriptor with a AppleScript subroutine descriptor with labeled arguments. If the the keyword keyASPrepositionGiven is used it should be the last label and have a argument of kind NSDictionary or NSAppleEventDescriptor as return from one of the userRecordDescriptorWithXXXX:.

The possible keywords are;

Key WordAppleScript key word
keyASPrepositionAboutabout
keyASPrepositionAboveabove
keyASPrepositionAgainstagainst
keyASPrepositionApartFromapart from
keyASPrepositionAroundaround
keyASPrepositionAsideFromaside from
keyASPrepositionAtat
keyASPrepositionBelowbelow
keyASPrepositionBeneathbeneath
keyASPrepositionBesidebeside
keyASPrepositionBetweenbetween
keyASPrepositionByby
keyASPrepositionForfor
keyASPrepositionFromfrom
keyASPrepositionGivengiven
keyASPrepositionInin
keyASPrepositionInsteadOfinstead of
keyASPrepositionIntointo
keyASPrepositionOnon
keyASPrepositionOntoonto
keyASPrepositionOutOfout of
keyASPrepositionOverover
keyASPrepositionSincesince
keyASPrepositionThroughthrough
keyASPrepositionThruthru
keyASPrepositionToto
keyASPrepositionUnderunder
keyASPrepositionUntiluntil
keyASPrepositionWithwith
keyASPrepositionWithoutwithout
keyASUserRecordFieldskey for a list descriptor of user record fields

To find out the rules for use of the key words see the AppleScript language documentation.

@param routineName The rountine name to be called. @param labels A c array of keywords @param objects A c array of objects that can be converted to NSAppleEventDescriptor with the method descriptorWithObject: @param count The number of keywords and objects. @result A NSAppleEventDescriptor for a subroutine with labeled arguments. */ - (id)initWithSubroutineName:(NSString *)routineName labels:(AEKeyword*)labels arguments:(id *)objects count:(unsigned int)count; /*! @method initWithSubroutineName:labelsAndArguments:arguments: @abstract Returns a NSAppleEventDescriptor for calling an AppleScript routine with labeled arguments. @discussion

initWithSubroutineName:labelsAndArguments:arguments: initializes a NSAppleEventDescriptor with an AppleScript subroutine with labeled arguments, if the keyword keyASPrepositionGiven is found the remaining arguments will be passed to the method userRecordDescriptorWithObjectAndKeys:arguments: and the result is given the keyword keyASUserRecordFields.

The possible keywords are;

Key WordAppleScript key word
keyASPrepositionAboutabout
keyASPrepositionAboveabove
keyASPrepositionAgainstagainst
keyASPrepositionApartFromapart from
keyASPrepositionAroundaround
keyASPrepositionAsideFromaside from
keyASPrepositionAtat
keyASPrepositionBelowbelow
keyASPrepositionBeneathbeneath
keyASPrepositionBesidebeside
keyASPrepositionBetweenbetween
keyASPrepositionByby
keyASPrepositionForfor
keyASPrepositionFromfrom
keyASPrepositionGivengiven
keyASPrepositionInin
keyASPrepositionInsteadOfinstead of
keyASPrepositionIntointo
keyASPrepositionOnon
keyASPrepositionOntoonto
keyASPrepositionOutOfout of
keyASPrepositionOverover
keyASPrepositionSincesince
keyASPrepositionThroughthrough
keyASPrepositionThruthru
keyASPrepositionToto
keyASPrepositionUnderunder
keyASPrepositionUntiluntil
keyASPrepositionWithwith
keyASPrepositionWithoutwithout
keyASUserRecordFieldskey for a list descriptor of user record fields

To find out the rules for use of the key words see the AppleScript language documentation.

See descriptorWithSubroutineName:labelsAndArguments:... for more details

@param routineName The rountine name to be called. @param label The first keyword of a list of labels and objects. @param argList The argument list struct. @result A NSAppleEventDescriptor for a subroutine with labeled arguments. */ - (id)initWithSubroutineName:(NSString *)routineName labelsAndArguments:(AEKeyword)label arguments:(va_list)argList; @end