How to find an app's id on macOS

Sometimes, you need to know the app id, like configuring the window manager to always put Slack on workspace number 6. To get the app id, you can use mdls and just give it the path to the app directory:

$ mdls -name kMDItemCFBundleIdentifier -r /Applications/Slack.app
com.tinyspeck.slackmacgap

~ /home 🏠 ~ talks 💬 ~ bash ~ craftsmanship ~ db ~ dongxi ~ emacs ~ escenic ~ iam ~ java ~ js ~ language ~ latex ~ ldap ~ life ~ linux ~ llm ~ mac-os-x ~ mt-foo ~ network ~ norsk ~ python ~ quotes ~ running ~ security ~ travel ~ unix ~ various ~ vcs ~ webdesign ~ windows ~ discoveries ~ cv 🧙 ~

Licensed under CC BY Creative Commons License ~ 📡 RSS feed ~ ✉ torstein.k.johansen @ gmail ~ 🐘 @skybert@hachyderm.io ~ 🎥 youtube.com/@skybert