Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7544239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:37:41+00:00 2026-05-30T08:37:41+00:00

Say you have the name of an application, Mail.app , how do you programmatically

  • 0

Say you have the name of an application, Mail.app, how do you programmatically obtain com.apple.mail from the application name?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:37:42+00:00Added an answer on May 30, 2026 at 8:37 am

    The following method will return an application’s Bundle Identifier for a named application:

    - (NSString *) bundleIdentifierForApplicationName:(NSString *)appName
    {
        NSWorkspace * workspace = [NSWorkspace sharedWorkspace];
        NSString * appPath = [workspace fullPathForApplication:appName];
        if (appPath) {
            NSBundle * appBundle = [NSBundle bundleWithPath:appPath];
            return [appBundle bundleIdentifier];
        }
        return nil; 
    }
    

    For Mail you can call the method like so:

    NSString * appID = [self bundleIdentifierForApplicationName:@"Mail"];
    

    appID now contains com.apple.mail

    Swift 5.1

    import AppKit
    
    func bundleIdentifier(forAppName appName: String) -> String? {
    
        let workspace = NSWorkspace.shared
        let appPath = workspace.fullPath(forApplication: appName)
        if let appPath = appPath {
            let appBundle = Bundle(path: appPath)
            return appBundle?.bundleIdentifier
        }
        return nil
    }
    
    // For Mail you can call the method like so:
    
    let appID = bundleIdentifier(forAppName: "Mail")
    

    Deprecation

    The fullPathForApplication: / fullPath(forApplication:) method has been deprecated in macOS 10.15 – it is unclear what the answer is going forward.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have SELECT name FROM table which gives me something like foo
Let say I have a post from like this: <form action=myApp/form_action.asp method=post> First name:
I have m2m field, lets say it have name 'relations', so i want to
Say I have my class @interface Person : NSObject { NSString *name; } I
Say I have a few string like Hi my name is <Name> Hi <name>,
Say I have a structure like: class SomeObject Public Name as String Public Created
Say I have the following in my models.py : class Company(models.Model): name = ...
I have a name in a database, lets say its DFectuoso and some legacy
Lets say I have the following code: abstract class Animal case class Dog(name:String) extends
Say I have two Activities in an Android application, EditPerson and EditEmployee . It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.