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

# array(byApplying:with:)

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

## Declaration

```swift
func array(byApplying aSelector: Selector, with argument: Any) -> [Any]
```

## Parameters

- `argument`: The value for the parameter of the message identified by selector.

## Return Value

Return Value A new array containing the results of sending the selector message to each object in the receiver, starting with the first object and continuing through the element array to the last object.

## Discussion

Discussion The method identified by selector must take a single argument—whose value is provided in argument—and must return an object. It should not have the side effect of modifying the receiving array. The order of the items in the result array corresponds to the order of the items in the original array.

## See Also

### Filtering an Element Array

- [array(byApplying:)](scriptingbridge/sbelementarray/array(byapplying:).md)
