<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSRangeSpecifier/init(containerClassDescription:containerSpecifier:key:start:end:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSRangeSpecifier(im)initWithContainerClassDescription:containerSpecifier:key:startSpecifier:endSpecifier:"
  },
  "title" : "init(containerClassDescription:containerSpecifier:key:start:end:)"
}
-->

# init(containerClassDescription:containerSpecifier:key:start:end:)

Returns a range specifier initialized with the given properties.

```
init(containerClassDescription classDesc: NSScriptClassDescription, containerSpecifier container: NSScriptObjectSpecifier?, key property: String, start startSpec: NSScriptObjectSpecifier?, end endSpec: NSScriptObjectSpecifier?)
```

## Parameters

`classDesc`

The class description.

`container`

The container.

`property`

The property.

`startSpec`

The object specifier representing the first object of the range.

`endSpec`

The object specifier representing the last object of the range.

## Return Value

A range specifier initialized with the given properties.

## Discussion

Invokes the super class’s [`init(containerClassDescription:containerSpecifier:key:)`](/documentation/Foundation/NSScriptObjectSpecifier/init(containerClassDescription:containerSpecifier:key:)) method and initializes the instance with the object specifiers representing the starting element, `startSpec`, and the ending element, `endSpec`, of a range of elements in the container.

## See Also

  [Cocoa Scripting Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_intro/SAppsIntro.html#//apple_ref/doc/uid/TP40002164)



---

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)