kasper / phoenix

A lightweight macOS window and app manager scriptable with JavaScript
https://kasper.github.io/phoenix/
Other
4.36k stars 128 forks source link

Get app by bundleIdentifier ? #343

Closed dan-phantom closed 6 months ago

dan-phantom commented 6 months ago

Hi, is it possible to get an app by bundleIdentifier and not the name?

I have a weird case when two apps have the same name "Simulator" but they are different and I guess Phoenix tries to maximise the wrong one.

Thank you 🤗

Screenshot 2024-02-09 at 20 40 37
kasper commented 6 months ago

Hi @dan-phantom! If the app is already running, you can do something like the following.

const match = App.all().find(app => app.bundleIdentifier() === 'identifier');
dan-phantom commented 6 months ago

I don't know why I didn't think of this, thank you 🙏