# UIHelper.waitForAll

Wait until every selector has a match.

```js
ui.waitForAll(selectors, optionsOrTimeout?)
```

## Arguments

| Argument | Type | Meaning |
| --- | --- | --- |
| `selectors` | array | 1..32 selectors; one query per poll. |
| `optionsOrTimeout` | object \| number | Optional milliseconds, or {timeout:5000, interval:100, throwOnTimeout:true}. Interval is at least 10 ms. |

## Returns

Element array in selector order. Matches need not be distinct. Timeout throws, or returns null when disabled.

## Example

```js
const ui = UIHelper.forApp("com.example.app");
const [title, done] = ui.waitForAll([{id: "title"}, {id: "done", enabled: true}], 5000);
console.log(title.getText());
```

## Notes

Replace example identifiers with selectors verified in your app. Pinning an app does not open it. Global shortcuts use the unpinned foreground-app client.

## Also available as

`waitForAll`.

[All JavaScript APIs](https://mcp.applesauceos.com/doc/api.md) · [Automation playbook](https://mcp.applesauceos.com/doc/ai.md)
