Mac Developer Library

Developer

Foundation Framework Reference NSPositionalSpecifier Class Reference

Options
Deployment Target:

On This Page
Language:

NSPositionalSpecifier

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

Inheritance


Conforms To


Import Statement


import Foundation @import Foundation;

Availability


Available in OS X v10.0 and later.
  • Initializes a positional specifier with a given position relative to another given specifier.

    Declaration

    Swift

    init(position position: NSInsertionPosition, objectSpecifier specifier: NSScriptObjectSpecifier)

    Objective-C

    - (instancetype)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.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Swift

    var insertionContainer: AnyObject? { get }

    Objective-C

    @property(readonly, retain) id insertionContainer

    Return Value

    A container. Determined by evaluating the receiver.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Swift

    var insertionIndex: Int { get }

    Objective-C

    @property(readonly) NSInteger insertionIndex

    Return Value

    An insertion index. Determined by evaluating the receiver.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Swift

    var insertionKey: String? { get }

    Objective-C

    @property(readonly, copy) NSString *insertionKey

    Return Value

    A key. Determined by evaluating the receiver.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.

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

    Declaration

    Swift

    var insertionReplaces: Bool { get }

    Objective-C

    @property(readonly) BOOL insertionReplaces

    Return Value

    YEStrue 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; NOfalse otherwise.

    Discussion

    If this object has never been evaluated, evaluation is attempted.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

  • Returns the object specifier specified at initialization time.

    Declaration

    Swift

    var objectSpecifier: NSScriptObjectSpecifier { get }

    Objective-C

    @property(readonly, retain) NSScriptObjectSpecifier *objectSpecifier

    Return Value

    An object specifier for a container.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.5 and later.

  • Returns the insertion position specified at initialization time.

    Declaration

    Swift

    var position: NSInsertionPosition { get }

    Objective-C

    @property(readonly) NSInsertionPosition position

    Return Value

    An insertion position.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.5 and later.

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

    Declaration

    Swift

    func setInsertionClassDescription(_ classDescription: NSScriptClassDescription)

    Objective-C

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

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

Data Types

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

    Declaration

    Swift

    enum NSInsertionPosition : UInt { case PositionAfter case PositionBefore case PositionBeginning case PositionEnd case PositionReplace }

    Objective-C

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

    Constants

    • PositionAfter

      NSPositionAfter

      Specifies a position after another object.

      Available in OS X v10.0 and later.

    • PositionBefore

      NSPositionBefore

      Specifies a position before another object.

      Available in OS X v10.0 and later.

    • PositionBeginning

      NSPositionBeginning

      Specifies a position at the beginning of a collection.

      Available in OS X v10.0 and later.

    • PositionEnd

      NSPositionEnd

      Specifies a position at the end of a collection.

      Available in OS X v10.0 and later.

    • PositionReplace

      NSPositionReplace

      Specifies a position in the place of another object.

      Available in OS X v10.0 and later.

    Discussion

    These constants are described in NSPositionalSpecifier.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.0 and later.