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

# SBElementArray

`SBElementArray` is subclass of `NSMutableArray` that manages collections of
related
[`SBObject`](/documentation/ScriptingBridge/SBObject)
objects. For example, when you ask the Finder for a list of disks, or ask
iTunes for a list of playlists, you get the result back as an
`SBElementArray` containing Scripting Bridge objects representing those
items.

```
class SBElementArray
```

## Overview

`SBElementArray` defines methods beyond those of
<doc://com.apple.documentation/documentation/Foundation/NSArray> for
obtaining individual objects. In addition to
<doc://com.apple.documentation/documentation/Foundation/NSArray/object(at:)>,
`SBElementArray` also defines [`object(withName:)`](/documentation/ScriptingBridge/SBElementArray/object(withName:)),
[`object(withID:)`](/documentation/ScriptingBridge/SBElementArray/object(withID:)), and [`object(atLocation:)`](/documentation/ScriptingBridge/SBElementArray/object(atLocation:)).

## Subclassing Notes

The `SBElementArray` class is not designed for subclassing.

## Topics

### Getting Objects in the Array

[`object(withName:)`](/documentation/ScriptingBridge/SBElementArray/object(withName:))

Returns the object in the array with the given name.

[`object(withID:)`](/documentation/ScriptingBridge/SBElementArray/object(withID:))

Returns the object in the array with the given identifier.

[`object(atLocation:)`](/documentation/ScriptingBridge/SBElementArray/object(atLocation:))

Returns the object at the given location in the receiver.

### Getting the Referenced Array

[`get()`](/documentation/ScriptingBridge/SBElementArray/get())

Forces evaluation of the receiver, causing the real object to be returned
immediately.

### Filtering an Element Array

[`array(byApplying:)`](/documentation/ScriptingBridge/SBElementArray/array(byApplying:))

Returns an array containing the results of sending the specified message to
each object in the receiver.

[`array(byApplying:with:)`](/documentation/ScriptingBridge/SBElementArray/array(byApplying:with:))

Returns an array containing the results of sending the specified message to
each object in the receiver.



---

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)