![]() |
Constants for Object Specifier Records, Positions, and Logical and Comparison Operations |
Header: AEObjects.h |
Specify the types of the four keyword-specified descriptors that make up the data in an object specifier record, as well as constants for position, logical operations, and comparison operations..
enum { kAEAND = 'AND ', kAEOR = 'OR ', kAENOT = 'NOT ', kAEFirst = 'firs', kAELast = 'last', kAEMiddle = 'midd', kAEAny = 'any ', kAEAll = 'all ', kAENext = 'next', kAEPrevious = 'prev', keyAECompOperator = 'relo', keyAELogicalTerms = 'term', keyAELogicalOperator = 'logc', keyAEObject1 = 'obj1', keyAEObject2 = 'obj2', keyAEDesiredClass = 'want', keyAEContainer = 'from', keyAEKeyForm = 'form', keyAEKeyData = 'seld' };
Specifies a logical AND operation.
Specifies a logical OR operation.
Specifies a logical NOT operation.
The first element in the specified container.
Specifies the last element in the container.
Specifies the middle element in the container. If an object specifier record specifies kAEMiddle and the number of elements in the container is even, the Apple Event Manager rounds down. For example, in a range of four words the second word is the middle word.
Specifies a single element chosen at random from the container.
Specifies all the elements in the container.
Specifies the Apple event object after the container.
Specifies the Apple event object before the container.
Specifies a descriptor of typeType, whose data consists of one of the constant values described in
Specifies a descriptor of type typeAEList containing one or more comparison or logical descriptor records.
Specifies a descriptor of type typeEnumerated whose data is one of the logical operators (such as kAEAND) defined in
Identifies a descriptor record for the element that is currently being compared to the object or data specified by the descriptor record for the keyword keyAEObject2. Either object can be described by a descriptor record of type typeObjectSpecifier or typeObjectBeingExamined.
A descriptor record of typeObjectBeingExamined acts as a placeholder for each of the successive elements in a container when the Apple Event Manager tests those elements one at a time.
Identifies a descriptor record for the element that is currently being compared to the object or data specified by the descriptor record for the keyword keyAEObject1.
The keyword keyAEObject2 can also be used with a descriptor record of any other descriptor type whose data is to be compared to each element in a container.
A four-character code that identifies the object class of the specified object or objects.
Constants for object class IDs are described in
Specifies the container for the requested object or objects. The data is an object specifier record (or in some cases a null descriptor).
A four-character code that identifies the key form for the specified object or objects.
The constants for specifying the key form are described in
Data or nested descriptor records that specify a property, name, position, range, or test, depending on the key form.
The descriptor types used in object specifier records are described in
When you call the CreateLogicalDescriptor function to create a logical descriptor record, you pass one of the logical operators kAEAND, kAEOR, or kAENOT in the theLogicOperator parameter. The CreateLogicalDescriptor function creates a logical descriptor record that specifies a logical operation to perform on one or more operands.
The constants kAEFirst , kAELast , kAEMiddle , kAEAny, and kAEAll provide the key data for a keyword-specified descriptor record of key form formAbsolutePosition and descriptor type typeAbsoluteOrdinal.
The constants kAENext, and kAEPrevious provide the key data for a keyword-specified descriptor record of key form formRelativePosition.
Key form constants and descriptor type constants for object specifiers are defined in
The constants keyAELogicalTerms and keyAELogicalOperator define the keyword descriptors for a logical descriptor record. A logical descriptor record is a coerced AE record of type typeLogicalDescriptor that specifies a logical expressionthat is, an expression that the Apple Event Manager evaluates to either TRUE or FALSE.You can create a logical descriptor record with the CreateLogicalDescriptor function.
The data for a logical descriptor record consists of two keyword-specified descriptor records: the first with descriptor type keyAELogicalOperator, descriptor type typeEnumerated, and one of the logical operators defined in
The logical expression is constructed from a logical operator (one of the Boolean operators AND, OR, or NOT) and a list of logical terms to which the operator is applied (where NOT can only be used where the list of terms is a single-item list). Each logical term in the list can be either another logical descriptor record or a comparison descriptor record (described in
The Apple Event Manager short-circuits its evaluation of a logical expression as soon as one part of the expression fails a test. For example, if while testing a logical expression such as A AND B AND C the Apple Event Manager discovers that A AND B is not true, it will evaluate the expression to FALSE without testing C.
The constants keyAECompOperator, keyAEObject1, and keyAEObject2 define the keyword descriptors for a comparison descriptor record. A comparison descriptor record is a coerced AE record of type typeCompDescriptor that specifies an Apple event object and either another Apple event object or data for the Apple Event Manager to compare to the first object. You can create a logical descriptor record with the CreateCompDescriptor function.
The Apple Event Manager can also use the information in a comparison descriptor record to compare elements in a container, one at a time, either to an Apple event object or to data. The data for a comparison descriptor record consists of three keyword-specified descriptor records:
You dont have to support all the available comparison operators for all Apple event objects; for example, the begins with operator probably doesnt make sense for objects of type cRectangle. It is up to you to decide which comparison operators are appropriate for your application to support, and how to interpret them. If necessary, you can define your own custom comparison operators. If you think you need to do this, check the Apple Events and Scripting header files or the Mac OS Registry (a database collection of Apple Event and Scripting information distributed with AppleScript SDKs) to see if existing definitions of comparison operators can be adapted to the needs of your application.
An object specifier record is a coerced AE record of descriptor type typeObjectSpecifier whose data contains consists of four keyword-specified descriptors. The constants keyAEDesiredClass, keyAEContainer, keyAEKeyForm , and keyAEKeyData specify the keywords for the four descriptor types that together identify the specified object or objects.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)