Setting application to be the default application

  • Maybe someone can lead me in the right direction as I am not sure
    exactly what to look for in the docs.

    I know that based on an application's plist, you can associate your
    app with a file extension, so that your app will open .txt files
    instead of Text Edit. However, there are also other ways to establish
    these associations, such as clicking on a hyperlink starting with
    http:// should open that link in the default browser and one that
    starts with ftp:// should use the default FTP application.

    I have the "Default Apps" panel installed in my System Preferences and
    in the Apps section, my application does not even show up in there.
    There is also association by MIME Type, URLs, UTIs...

    How would I associate links like http: and ftp: with my application?
    What is the link that is associated with Instant Messaging
    applications? I ask this because in "Default Apps" there is the URLs
    section and there's an aim link that's associated with iChat, for
    example as well as iChat's own "ichat" URL. Would these be something
    like "ichat://username" or "aim://screenname"?
    What is a UTI?
    Where in the Cocoa documentation can I find info on this?

    Thanks!
  • UTIs and all of this stuff are outside the scope of Cocoa; they apply
    to all apps on the system. Documentation should be pretty easy to
    find. e.g. http://developer.apple.com/macosx/uniformtypeidentifiers.html

    Mike.

    On 8 Jan 2008, at 19:12, Ryan Homer wrote:

    > Maybe someone can lead me in the right direction as I am not sure
    > exactly what to look for in the docs.
    >
    > I know that based on an application's plist, you can associate your
    > app with a file extension, so that your app will open .txt files
    > instead of Text Edit. However, there are also other ways to
    > establish these associations, such as clicking on a hyperlink
    > starting with http:// should open that link in the default browser
    > and one that starts with ftp:// should use the default FTP
    > application.
    >
    > I have the "Default Apps" panel installed in my System Preferences
    > and in the Apps section, my application does not even show up in
    > there. There is also association by MIME Type, URLs, UTIs...
    >
    > How would I associate links like http: and ftp: with my application?
    > What is the link that is associated with Instant Messaging
    > applications? I ask this because in "Default Apps" there is the URLs
    > section and there's an aim link that's associated with iChat, for
    > example as well as iChat's own "ichat" URL. Would these be something
    > like "ichat://username" or "aim://screenname"?
    > What is a UTI?
    > Where in the Cocoa documentation can I find info on this?
    >
    > Thanks!
  • Thanks Mike. This info helps a lot.

    ---

    I have also discovered some additional information that may help
    others. While this is not Cocoa-specific, many Cocoa application
    developers will still need to know about this. Anyway, this associates
    your application with a particular type of URL. So if you are, for
    example, writing an FTP application (and I'm not ;-), then you need to
    make an entry into your application's info.plist file like this:

    <key>CFBundleURLTypes</key>
    <array>
    <dict>
      <key>CFBundleURLName</key>
      <string>FTP URL</string>
      <key>CFBundleURLSchemes</key>
      <array>
      <string>ftp</string>
      <string>sftp</string>
      .
      .
      .
      </array>
    </dict>
    </array>

    There seems to be no way to access this directly from Xcode. When you
    go into your application's target properties (the area where you set
    your Principal Class and Main Nib File), you may first think that this
    is all that's in your info.plist, but if you click on the "Open
    Info.plist as File" button, there's a lot more than the interface
    leads you to believe.

    On 8-Jan-08, at 2:27 PM, Mike Abdullah wrote:

    > UTIs and all of this stuff are outside the scope of Cocoa; they
    > apply to all apps on the system. Documentation should be pretty easy
    > to find. e.g. http://developer.apple.com/macosx/uniformtypeidentifiers.html
    >
    > Mike.
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today