---
title: "elementArray(withCode:)"
framework: Scripting Bridge
role: symbol
role_heading: Instance Method
platforms: [Mac Catalyst 13.0+, macOS 10.5+]
path: "scriptingbridge/sbobject/elementarray(withcode:)"
---

# elementArray(withCode:)

Returns an array containing every child of the receiver with the given class-type code.

## Declaration

```swift
func elementArray(withCode code: DescType) -> SBElementArray
```

## Parameters

- `code`: A four-character code that identifies a scripting class.

## Return Value

Return Value An SBElementArray object containing every child of the receiver whose class matches code.

## Discussion

Discussion SBObject subclasses use this method to implement application-specific property accessor methods. You should not need to call this method directly. note: This method doesn’t retrieve the value of the property. To get the value, call get().

## See Also

### Getting Properties and Elements

- [property(with:code:)](scriptingbridge/sbobject/property(with:code:).md)
- [property(withCode:)](scriptingbridge/sbobject/property(withcode:).md)
