kasper / phoenix

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

Get app by bundleIdentifier ? #343

Closed dan-phantom closed 9 months ago

dan-phantom commented 9 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 9 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 9 months ago

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