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

Evaluating a Positional Specifier

Instance Methods

evaluate

Causes the receiver to evaluate its position.

- (void)evaluate
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.h

initWithPosition:objectSpecifier:

Initializes a positional specifier with a given position relative to another given specifier.

- (id)initWithPosition:(NSInsertionPosition)position objectSpecifier:(NSScriptObjectSpecifier *)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.h

insertionContainer

Returns the container in which the new or copied object or objects should be placed.

- (id)insertionContainer
Return Value

A container. Determined by evaluating the receiver.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSScriptObjectSpecifiers.h

insertionIndex

Returns an insertion index that indicates where the new or copied object or objects should be placed.

- (NSInteger)insertionIndex
Return Value

An insertion index. Determined by evaluating the receiver.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSScriptObjectSpecifiers.h

insertionKey

Returns the key that identifies the relationship into which the new or copied object or objects should be inserted.

- (NSString *)insertionKey
Return Value

A key. Determined by evaluating the receiver.

Availability
  • Available in OS X v10.0 and later.
Declared In
NSScriptObjectSpecifiers.h

insertionReplaces

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.

- (BOOL)insertionReplaces
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.h

objectSpecifier

Returns the object specifier specified at initialization time.

- (NSScriptObjectSpecifier *)objectSpecifier
Return Value

An object specifier for a container.

Availability
  • Available in OS X v10.5 and later.
Declared In
NSScriptObjectSpecifiers.h

position

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.h

setInsertionClassDescription:

Sets the class description for the object or objects to be inserted.

- (void)setInsertionClassDescription:(NSScriptClassDescription *)classDescription
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.h

Constants

NSInsertionPosition

The following constants are defined by NSPositionalSpecifier to specify an insertion position.

typedef enum {
   NSPositionAfter,
   NSPositionBefore,
   NSPositionBeginning,
   NSPositionEnd,
   NSPositionReplace
} NSInsertionPosition;
Constants
NSPositionAfter

Specifies a position after another object.

Available in OS X v10.0 and later.

Declared in NSScriptObjectSpecifiers.h.

NSPositionBefore

Specifies a position before another object.

Available in OS X v10.0 and later.

Declared in NSScriptObjectSpecifiers.h.

NSPositionBeginning

Specifies a position at the beginning of a collection.

Available in OS X v10.0 and later.

Declared in NSScriptObjectSpecifiers.h.

NSPositionEnd

Specifies a position at the end of a collection.

Available in OS X v10.0 and later.

Declared in NSScriptObjectSpecifiers.h.

NSPositionReplace

Specifies 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