<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSPositionalSpecifier",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPositionalSpecifier"
  },
  "title" : "NSPositionalSpecifier"
}
-->

# NSPositionalSpecifier

A specifier for an insertion point in a container relative to another object in the container.

```
class NSPositionalSpecifier
```

## 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`.

## Topics

### Initializing a positional specifier

[`-  initWithPosition:objectSpecifier:`](/documentation/Foundation/NSPositionalSpecifier/init(position:objectSpecifier:))

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

### Accessing information about a positional specifier

[`insertionContainer`](/documentation/Foundation/NSPositionalSpecifier/insertionContainer)

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

[`insertionIndex`](/documentation/Foundation/NSPositionalSpecifier/insertionIndex)

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

[`insertionKey`](/documentation/Foundation/NSPositionalSpecifier/insertionKey)

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

[`insertionReplaces`](/documentation/Foundation/NSPositionalSpecifier/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.

[`objectSpecifier`](/documentation/Foundation/NSPositionalSpecifier/objectSpecifier)

Returns the object specifier specified at initialization time.

[`position`](/documentation/Foundation/NSPositionalSpecifier/position)

Returns the insertion position specified at initialization time.

[`-  setInsertionClassDescription:`](/documentation/Foundation/NSPositionalSpecifier/setInsertionClassDescription(_:))

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

### Evaluating a positional specifier

[`-  evaluate`](/documentation/Foundation/NSPositionalSpecifier/evaluate())

Causes the receiver to evaluate its position.

### Constants

[`InsertionPosition`](/documentation/Foundation/NSPositionalSpecifier/InsertionPosition)

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

## Relationships

### Conforms To

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)