Call an application from Context Menu plugin.

Discussion in 'Mac Programming' started by imranpundeer, Feb 16, 2009.

  1. macrumors newbie

    Joined:
    Jan 10, 2009
    #1
    Hi All,
    I am new in MAC programming. I made a plgin for Context Menu Handler.
    I added an element in Context Menu and want to launch an application after click the menu item with command lin argument. Please help me out how can i launch the application through click of that menu handler.

    Any helpp would be appricated.

    Regards,
    Imran.
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    You can use Launch Services to open an application. Here's a sample:
    Code:
    CFStringRef path = CFSTR("/Applications/TextEdit.app");
    CFURLRef appURL = CFURLCreateWithFileSystemPath(NULL, path, kCFURLPOSIXPathStyle, false);
    LSOpenCFURLRef(appURL, NULL);
    CFRelease(appURL);
     

Share This Page