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

# object(atLocation:)

Returns the object at the given location in the receiver.

```
func object(atLocation location: Any) -> Any
```

## Return Value

A reference to the [`SBObject`](/documentation/ScriptingBridge/SBObject) object identified by `loc` or
`nil` if the object couldn’t be located.

## Discussion

This method is a generalization of
<doc://com.apple.documentation/documentation/Foundation/NSArray/object(at:)>
for applications where the “index” is not simply an integer. For example,
Finder can specify objects using a
<doc://com.apple.documentation/documentation/Foundation/NSURL> object as a
location. In OSA this is known as “absolute position,” a generalization of
the notion of “index” in Foundation—it could be an integer, but it doesn’t
have to be. A single object may even have a number of different “absolute
position” values depending on the container.

---

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)