NSPositionalSpecifier Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSScriptObjectSpecifiers.h |
Overview
Instances of NSPositionalSpecifier specify an insertion point in a container relative to another object in the container, for example, before first word or after paragraph 4. The container is specified by an instance of NSScriptObjectSpecifier. NSPositionalSpecifier objects commonly encapsulate object specifiers used as arguments to the make (create) and move commands and indicate where the created or moved object is to be inserted relative to the object represented by an object specifier.
Invoking an accessor method to obtain information about an instance of NSPositionalSpecifier causes the object to be evaluated if it hasn’t been already.
You don’t normally subclass NSPositionalSpecifier.
Tasks
Initializing a Positional Specifier
Accessing Information About a Positional Specifier
-
– insertionContainer -
– insertionIndex -
– insertionKey -
– insertionReplaces -
– objectSpecifier -
– position -
– setInsertionClassDescription:
Evaluating a Positional Specifier
Instance Methods
evaluate
Causes the receiver to evaluate its position.
Discussion
Calling insertionContainer, insertionKey, insertionIndex, or insertionReplaces also causes the receiver to be evaluated, if it hasn’t already been evaluated.
Availability
- Available in OS X v10.0 and later.
Declared In
NSScriptObjectSpecifiers.hinitWithPosition:objectSpecifier:
Initializes a positional specifier with a given position relative to another given specifier.
Parameters
- position
The position for the new specifier relative to specifier.
- specifier
The reference specifier.
Return Value
An initialized positional specifier with the position specified by position relative to the object specified by specifier.
Availability
- Available in OS X v10.0 and later.
Declared In
NSScriptObjectSpecifiers.hinsertionContainer
Returns the container in which the new or copied object or objects should be placed.
Return Value
A container. Determined by evaluating the receiver.
Availability
- Available in OS X v10.0 and later.
Declared In
NSScriptObjectSpecifiers.hinsertionIndex
Returns an insertion index that indicates where the new or copied object or objects should be placed.
Return Value
An insertion index. Determined by evaluating the receiver.
Availability
- Available in OS X v10.0 and later.
Declared In
NSScriptObjectSpecifiers.hinsertionKey
Returns the key that identifies the relationship into which the new or copied object or objects should be inserted.
Return Value
A key. Determined by evaluating the receiver.
Availability
- Available in OS X v10.0 and later.
Declared In
NSScriptObjectSpecifiers.hinsertionReplaces
Returns a Boolean value that indicates whether evaluation has been successful and the object to be inserted should actually replace the keyed, indexed object in the insertion container.
Return Value
YES if evaluation has been successful and the object to be inserted should actually replace the keyed, indexed object in the insertion container, instead of being inserted before it; NO otherwise.
Discussion
If this object has never been evaluated, evaluation is attempted.
Availability
- Available in OS X v10.2 and later.
Declared In
NSScriptObjectSpecifiers.hobjectSpecifier
Returns the object specifier specified at initialization time.
Return Value
An object specifier for a container.
Availability
- Available in OS X v10.5 and later.
Declared In
NSScriptObjectSpecifiers.hposition
Returns the insertion position specified at initialization time.
Return Value
An insertion position.
Availability
- Available in OS X v10.5 and later.
Declared In
NSScriptObjectSpecifiers.hsetInsertionClassDescription:
Sets the class description for the object or objects to be inserted.
Parameters
- classDescription
The class description for the object or objects to be inserted.
Discussion
This message can be sent at any time after object initialization, but must be sent before evaluation to have any effect.
Availability
- Available in OS X v10.2 and later.
Declared In
NSScriptObjectSpecifiers.hConstants
NSInsertionPosition
The following constants are defined by NSPositionalSpecifier to specify an insertion position.
typedef enum {
NSPositionAfter,
NSPositionBefore,
NSPositionBeginning,
NSPositionEnd,
NSPositionReplace
} NSInsertionPosition;
Constants
NSPositionAfterSpecifies a position after another object.
Available in OS X v10.0 and later.
Declared in
NSScriptObjectSpecifiers.h.NSPositionBeforeSpecifies a position before another object.
Available in OS X v10.0 and later.
Declared in
NSScriptObjectSpecifiers.h.NSPositionBeginningSpecifies a position at the beginning of a collection.
Available in OS X v10.0 and later.
Declared in
NSScriptObjectSpecifiers.h.NSPositionEndSpecifies a position at the end of a collection.
Available in OS X v10.0 and later.
Declared in
NSScriptObjectSpecifiers.h.NSPositionReplaceSpecifies a position in the place of another object.
Available in OS X v10.0 and later.
Declared in
NSScriptObjectSpecifiers.h.
Discussion
These constants are described in NSPositionalSpecifier.
Availability
- Available in OS X v10.0 and later.
Declared In
NSScriptObjectSpecifiers.h© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-06-29)