I am writing an application which stores data about other applications. I can find the current front most application and its information easily enough:
let frontApp = NSWorkspace.shared.frontmostApplication!
and from there I can get:
let currentAppName = currentApp.localizedName ?? "Dunno"
let currentAppIcon = currentApp.icon
If the application is not in the foreground, I know I can iterate through other running applications:
let apps = NSWorkspace.shared.runningApplications
for app in apps as [NSRunningApplication] {
print(app.localizedName ?? "whatever")
print(app.bundleIdentifier ?? "bundle")
}
I would like to get the same information about a application which is not currently running, but for which I do have the bundle identifier. How can I get this?