---
title: "object(atLocation:)"
framework: Scripting Bridge
role: symbol
role_heading: Instance Method
platforms: [Mac Catalyst 13.0+, macOS 10.5+]
path: "scriptingbridge/sbelementarray/object(atlocation:)"
---

# object(atLocation:)

Returns the object at the given location in the receiver.

## Declaration

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

## Return Value

Return Value A reference to the SBObject object identified by loc or nil if the object couldn’t be located.

## Discussion

Discussion This method is a generalization of object(at:) for applications where the “index” is not simply an integer. For example, Finder can specify objects using a 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.

## See Also

### Getting Objects in the Array

- [object(withName:)](scriptingbridge/sbelementarray/object(withname:).md)
- [object(withID:)](scriptingbridge/sbelementarray/object(withid:).md)
