Open my Application via safari

  • Hi to all,

    I read one of my old post asking how to launch my application via
    safari using link like aim: or similar.
    I've found a file com.Apple.LauchServices.plist , but someone told me
    to don't touch that file.
    Anyway I saw that Adium for example, modify that file ....
    How can I obtain the same result without editing that file?
    Is there any documentation about it?

    thank you all for your kind support
    Yorh
  • On Oct 31, 2006, at 9:43 AM, Yorh wrote:

    > I read one of my old post asking how to launch my application via
    > safari using link like aim: or similar.
    > I've found a file com.Apple.LauchServices.plist , but someone told
    > me to don't touch that file.

    Good advice.

    > Anyway I saw that Adium for example, modify that file ....

    I doubt that. I haven't looked at Adium, but it's more likely that it
    simply included a list of supported URL schemes in its Info.plist.
    Finder will read that and update the Launch Services database just
    like it will read and register a list of supported file extensions.

    > Is there any documentation about it?

    Have a look at <http://tinyurl.com/794ob>.

    Long URL:
    <http://developer.apple.com/documentation/MacOSX/Conceptual/
    BPRuntimeConfig/Articles/PListKeys.html
    >

    The description for the CFBundleURLTypes key is about halfway down
    the page.

    sherm--

    Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    Cocoa programming in Perl: http://camelbones.sourceforge.net
  • Thank you very much for your support
    Yorh

    On 31/ott/06, at 16:46, Sherm Pendley wrote:

    > On Oct 31, 2006, at 9:43 AM, Yorh wrote:
    >
    >> I read one of my old post asking how to launch my application via
    >> safari using link like aim: or similar.
    >> I've found a file com.Apple.LauchServices.plist , but someone told
    >> me to don't touch that file.
    >
    > Good advice.
    >
    >> Anyway I saw that Adium for example, modify that file ....
    >
    > I doubt that. I haven't looked at Adium, but it's more likely that
    > it simply included a list of supported URL schemes in its
    > Info.plist. Finder will read that and update the Launch Services
    > database just like it will read and register a list of supported
    > file extensions.
    >
    >> Is there any documentation about it?
    >
    > Have a look at <http://tinyurl.com/794ob>.
    >
    > Long URL:
    > <http://developer.apple.com/documentation/MacOSX/Conceptual/
    > BPRuntimeConfig/Articles/PListKeys.html>
    >
    > The description for the CFBundleURLTypes key is about halfway down
    > the page.
    >
    > sherm--
    >
    > Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    > Cocoa programming in Perl: http://camelbones.sourceforge.net
    >
    >
  • On Tue, 31 Oct 2006 15:43:48 +0100, Yorh <list...> said:
    > Hi to all,
    >
    > I read one of my old post asking how to launch my application via
    > safari using link like aim: or similar.
    > I've found a file com.Apple.LauchServices.plist , but someone told me
    > to don't touch that file.
    > Anyway I saw that Adium for example, modify that file ....
    > How can I obtain the same result without editing that file?

    Are you asking for a user interface way or a programmatic way?

    If you mean a user interface way, I use RCDefaultApp:

    <http://www.rubicode.com/Software/RCDefaultApp/>

    If you mean programmatic, then just look at the docs for LaunchServices:

    <http://developer.apple.com/documentation/Carbon/Conceptual/LaunchServicesCo
    ncepts/LSCConcepts/chapter_2_section_4.html
    >

    m.

    --
    matt neuburg, phd = <matt...>, <http://www.tidbits.com/matt/>
    A fool + a tool + an autorelease pool = cool!
    AppleScript: the Definitive Guide - Second Edition!
    <http://www.amazon.com/gp/product/0596102119>
  • Hello again,

    I have in my info.plist file this:

    <key>CFBundleURLTypes</key>
    <array>
      <dict>
      <key>CFBundleURLIconFile</key>
      <string>myApp</string>
      <key>CFBundleURLName</key>
      <string>my URL</string>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>myLink</string>
      </array>
      </dict>
    </array>

    But it seems wrong because if I have in a web page myLink://
    something .... nothing happen :(

    Where is the mistake?

    Thank you all
    Yorh

    On 31/ott/06, at 16:52, Yorh wrote:

    > Thank you very much for your support
    > Yorh
    >
    > On 31/ott/06, at 16:46, Sherm Pendley wrote:
    >
    >> On Oct 31, 2006, at 9:43 AM, Yorh wrote:
    >>
    >>> I read one of my old post asking how to launch my application via
    >>> safari using link like aim: or similar.
    >>> I've found a file com.Apple.LauchServices.plist , but someone
    >>> told me to don't touch that file.
    >>
    >> Good advice.
    >>
    >>> Anyway I saw that Adium for example, modify that file ....
    >>
    >> I doubt that. I haven't looked at Adium, but it's more likely that
    >> it simply included a list of supported URL schemes in its
    >> Info.plist. Finder will read that and update the Launch Services
    >> database just like it will read and register a list of supported
    >> file extensions.
    >>
    >>> Is there any documentation about it?
    >>
    >> Have a look at <http://tinyurl.com/794ob>.
    >>
    >> Long URL:
    >> <http://developer.apple.com/documentation/MacOSX/Conceptual/
    >> BPRuntimeConfig/Articles/PListKeys.html>
    >>
    >> The description for the CFBundleURLTypes key is about halfway down
    >> the page.
    >>
    >> sherm--
    >>
    >> Web Hosting by West Virginians, for West Virginians: http://wv-
    >> www.net
    >> Cocoa programming in Perl: http://camelbones.sourceforge.net
    >>
    >>
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/list%
    > 40metagraphics.it
    >
    > This email sent to <list...>
  • On Oct 31, 2006, at 12:20 PM, Yorh wrote:

    > Hello again,
    >
    > I have in my info.plist file this:
    >
    > <key>CFBundleURLTypes</key>
    > <array>
    > <dict>
    > <key>CFBundleURLIconFile</key>
    > <string>myApp</string>
    > <key>CFBundleURLName</key>
    > <string>my URL</string>
    > <key>CFBundleURLSchemes</key>
    > <array>
    > <string>myLink</string>
    > </array>
    > </dict>
    > </array>
    >
    > But it seems wrong because if I have in a web page myLink://
    > something .... nothing happen :(
    >
    > Where is the mistake?

    Try copying your built app to a new folder. That should cause Finder
    to read the app's Info.plist and update the Launch Services database.

    sherm--

    Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    Cocoa programming in Perl: http://camelbones.sourceforge.net
  • On 31 Oct 2006, at 18:06, Sherm Pendley wrote:

    > On Oct 31, 2006, at 12:20 PM, Yorh wrote:
    >
    >> Hello again,
    >>
    >> I have in my info.plist file this:
    >>
    >> <key>CFBundleURLTypes</key>
    >> <array>
    >> <dict>
    >> <key>CFBundleURLIconFile</key>
    >> <string>myApp</string>
    >> <key>CFBundleURLName</key>
    >> <string>my URL</string>
    >> <key>CFBundleURLSchemes</key>
    >> <array>
    >> <string>myLink</string>
    >> </array>
    >> </dict>
    >> </array>
    >>
    >> But it seems wrong because if I have in a web page myLink://
    >> something .... nothing happen :(
    >>
    >> Where is the mistake?
    >
    > Try copying your built app to a new folder. That should cause
    > Finder to read the app's Info.plist and update the Launch Services
    > database.

    Incrementing the CFBundleVersion (commonly used as a build number)
    can help too.

    Dave.

    ------
    David Kennedy (http://www.zenopolis.com)
  • Thank you for support,

    I moved my built release in my Applications folder without any
    success... I tried to increase the bundleversion but without any
    other success too...

    I can't understand why the Finder doesn't read my info.plist file :(

    Anyone has some information about it?
    Thank you all
    Yorh

    On 31/ott/06, at 19:06, Sherm Pendley wrote:

    > On Oct 31, 2006, at 12:20 PM, Yorh wrote:
    >
    >> Hello again,
    >>
    >> I have in my info.plist file this:
    >>
    >> <key>CFBundleURLTypes</key>
    >> <array>
    >> <dict>
    >> <key>CFBundleURLIconFile</key>
    >> <string>myApp</string>
    >> <key>CFBundleURLName</key>
    >> <string>my URL</string>
    >> <key>CFBundleURLSchemes</key>
    >> <array>
    >> <string>myLink</string>
    >> </array>
    >> </dict>
    >> </array>
    >>
    >> But it seems wrong because if I have in a web page myLink://
    >> something .... nothing happen :(
    >>
    >> Where is the mistake?
    >
    > Try copying your built app to a new folder. That should cause
    > Finder to read the app's Info.plist and update the Launch Services
    > database.
    >
    > sherm--
    >
    > Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    > Cocoa programming in Perl: http://camelbones.sourceforge.net
    >
    >
  • So at the moment, does a link of the form myLink://something not work
    at all?  I mean there's two levels to which this can work:

    1.  The app simply launches but doesn't open anything
    2.  The app launches at gets content from the URL.

    Is neither happening here, or have you reached level 1 and want to
    progress to 2?

    Mike.

    On 1 Nov 2006, at 11:31, Yorh wrote:

    > Thank you for support,
    >
    > I moved my built release in my Applications folder without any
    > success... I tried to increase the bundleversion but without any
    > other success too...
    >
    > I can't understand why the Finder doesn't read my info.plist file :(
    >
    > Anyone has some information about it?
    > Thank you all
    > Yorh
    >
    > On 31/ott/06, at 19:06, Sherm Pendley wrote:
    >
    >> On Oct 31, 2006, at 12:20 PM, Yorh wrote:
    >>
    >>> Hello again,
    >>>
    >>> I have in my info.plist file this:
    >>>
    >>> <key>CFBundleURLTypes</key>
    >>> <array>
    >>> <dict>
    >>> <key>CFBundleURLIconFile</key>
    >>> <string>myApp</string>
    >>> <key>CFBundleURLName</key>
    >>> <string>my URL</string>
    >>> <key>CFBundleURLSchemes</key>
    >>> <array>
    >>> <string>myLink</string>
    >>> </array>
    >>> </dict>
    >>> </array>
    >>>
    >>> But it seems wrong because if I have in a web page myLink://
    >>> something .... nothing happen :(
    >>>
    >>> Where is the mistake?
    >>
    >> Try copying your built app to a new folder. That should cause
    >> Finder to read the app's Info.plist and update the Launch Services
    >> database.
    >>
    >> sherm--
    >>
    >> Web Hosting by West Virginians, for West Virginians: http://wv-
    >> www.net
    >> Cocoa programming in Perl: http://camelbones.sourceforge.net
    >>
    >>
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/mike.abdullah%
    > 40gmail.com
    >
    > This email sent to <mike.abdullah...>
  • Hi Mike,

    Sigh... If I try to click on myApp:// link my app isn't launched.
    If I check in my LaucheServices.plist I cannot find the new
    definitions...

    I cannot understand why.

    Thank you
    Yorh

    On 01/nov/06, at 18:25, Mike Abdullah wrote:

    > So at the moment, does a link of the form myLink://something not
    > work at all?  I mean there's two levels to which this can work:
    >
    > 1.  The app simply launches but doesn't open anything
    > 2.  The app launches at gets content from the URL.
    >
    > Is neither happening here, or have you reached level 1 and want to
    > progress to 2?
    >
    > Mike.
    >
    > On 1 Nov 2006, at 11:31, Yorh wrote:
    >
    >> Thank you for support,
    >>
    >> I moved my built release in my Applications folder without any
    >> success... I tried to increase the bundleversion but without any
    >> other success too...
    >>
    >> I can't understand why the Finder doesn't read my info.plist file :(
    >>
    >> Anyone has some information about it?
    >> Thank you all
    >> Yorh
    >>
    >> On 31/ott/06, at 19:06, Sherm Pendley wrote:
    >>
    >>> On Oct 31, 2006, at 12:20 PM, Yorh wrote:
    >>>
    >>>> Hello again,
    >>>>
    >>>> I have in my info.plist file this:
    >>>>
    >>>> <key>CFBundleURLTypes</key>
    >>>> <array>
    >>>> <dict>
    >>>> <key>CFBundleURLIconFile</key>
    >>>> <string>myApp</string>
    >>>> <key>CFBundleURLName</key>
    >>>> <string>my URL</string>
    >>>> <key>CFBundleURLSchemes</key>
    >>>> <array>
    >>>> <string>myLink</string>
    >>>> </array>
    >>>> </dict>
    >>>> </array>
    >>>>
    >>>> But it seems wrong because if I have in a web page myLink://
    >>>> something .... nothing happen :(
    >>>>
    >>>> Where is the mistake?
    >>>
    >>> Try copying your built app to a new folder. That should cause
    >>> Finder to read the app's Info.plist and update the Launch
    >>> Services database.
    >>>
    >>> sherm--
    >>>
    >>> Web Hosting by West Virginians, for West Virginians: http://wv-
    >>> www.net
    >>> Cocoa programming in Perl: http://camelbones.sourceforge.net
    >>>
    >>>
    >>
    >> _______________________________________________
    >> Do not post admin requests to the list. They will be ignored.
    >> Cocoa-dev mailing list      (<Cocoa-dev...>)
    >> Help/Unsubscribe/Update your Subscription:
    >> http://lists.apple.com/mailman/options/cocoa-dev/mike.abdullah%
    >> 40gmail.com
    >>
    >> This email sent to <mike.abdullah...>
    >
  • I searched a lot on the web and I found some answeres about it... but
    none works for me.

    I read something about  LSRegisterURL() ... maybe I can use this
    function to force LaunchServices to read and register my application?
    I tried with a new app too (to check if this is a problem of my app
    or a OS problem), and it doesn't works with other apps too... but my
    Adium copy works great... so I'm making something wrong.

    Let me explain my steps:
    Changed info.plist file by hand
    Clean all on xcode
    Rebuild
    Moved my application in /Applications folder

    ... but nothing changed if I go to check my launchservices I cannot
    see my application listed...

    I really need help
    Thank you all
    Yorh

    On 02/nov/06, at 09:55, Yorh wrote:

    > Hi Mike,
    >
    > Sigh... If I try to click on myApp:// link my app isn't launched.
    > If I check in my LaucheServices.plist I cannot find the new
    > definitions...
    >
    > I cannot understand why.
    >
    > Thank you
    > Yorh
    >
    > On 01/nov/06, at 18:25, Mike Abdullah wrote:
    >
    >> So at the moment, does a link of the form myLink://something not
    >> work at all?  I mean there's two levels to which this can work:
    >>
    >> 1.  The app simply launches but doesn't open anything
    >> 2.  The app launches at gets content from the URL.
    >>
    >> Is neither happening here, or have you reached level 1 and want to
    >> progress to 2?
    >>
    >> Mike.
    >>
    >> On 1 Nov 2006, at 11:31, Yorh wrote:
    >>
    >>> Thank you for support,
    >>>
    >>> I moved my built release in my Applications folder without any
    >>> success... I tried to increase the bundleversion but without any
    >>> other success too...
    >>>
    >>> I can't understand why the Finder doesn't read my info.plist file :(
    >>>
    >>> Anyone has some information about it?
    >>> Thank you all
    >>> Yorh
    >>>
    >>> On 31/ott/06, at 19:06, Sherm Pendley wrote:
    >>>
    >>>> On Oct 31, 2006, at 12:20 PM, Yorh wrote:
    >>>>
    >>>>> Hello again,
    >>>>>
    >>>>> I have in my info.plist file this:
    >>>>>
    >>>>> <key>CFBundleURLTypes</key>
    >>>>> <array>
    >>>>> <dict>
    >>>>> <key>CFBundleURLIconFile</key>
    >>>>> <string>myApp</string>
    >>>>> <key>CFBundleURLName</key>
    >>>>> <string>my URL</string>
    >>>>> <key>CFBundleURLSchemes</key>
    >>>>> <array>
    >>>>> <string>myLink</string>
    >>>>> </array>
    >>>>> </dict>
    >>>>> </array>
    >>>>>
    >>>>> But it seems wrong because if I have in a web page myLink://
    >>>>> something .... nothing happen :(
    >>>>>
    >>>>> Where is the mistake?
    >>>>
    >>>> Try copying your built app to a new folder. That should cause
    >>>> Finder to read the app's Info.plist and update the Launch
    >>>> Services database.
    >>>>
    >>>> sherm--
  • On Nov 2, 2006, at 3:17 AM, Yorh wrote:

    > I really need help

    It works so keep trying. Likely your Info.plist isn't getting updated
    in the application you build or launch services isn't updating its
    database. ...of course it sounds like you tried the normal steps to
    do that so...

    What OS are you running?

    Try creating another account on the system and copy your application
    into ~/Application of that account (creating ~/Application as needed).

    Try to directly get launch services to parse your application bundle.
    "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/
    LaunchServices.framework/Support/lsregister -fR MyApplication.app"

    Finally try rebuilding the launch services database.
    <http://www.macosxhints.com/article.php?
    story=20031215144430486&mode=print
    >

    -Shawn
  • Hi Shawn,

    Thank you for help
    I'm trying my app both on Tiger PPC and Macbook pro (intel), both of
    them doesn't upgrade launchservices database....

    Cannot really understand why.

    I'm trying to rebuild it manually, but my question is: all the users
    that has already my app in their Applications folder ... how can they
    upgrade their launcheservices database after download the new version
    of my app?

    Thank you for your kind support
    Yorh

    On Nov 2, 2006, at 4:52 PM, Shawn Erickson wrote:

    >
    > On Nov 2, 2006, at 3:17 AM, Yorh wrote:
    >
    >> I really need help
    >
    > It works so keep trying. Likely your Info.plist isn't getting
    > updated in the application you build or launch services isn't
    > updating its database. ...of course it sounds like you tried the
    > normal steps to do that so...
    >
    > What OS are you running?
    >
    > Try creating another account on the system and copy your
    > application into ~/Application of that account (creating ~/
    > Application as needed).
    >
    > Try to directly get launch services to parse your application bundle.
    > "/System/Library/Frameworks/ApplicationServices.framework/
    > Frameworks/LaunchServices.framework/Support/lsregister -fR
    > MyApplication.app"
    >
    > Finally try rebuilding the launch services database.
    > <http://www.macosxhints.com/article.php?
    > story=20031215144430486&mode=print>
    >
    > -Shawn
  • On Nov 2, 2006, at 8:02 AM, Yorh wrote:

    > Hi Shawn,
    >
    > Thank you for help
    > I'm trying my app both on Tiger PPC and Macbook pro (intel), both
    > of them doesn't upgrade launchservices database....
    >
    > Cannot really understand why.
    >
    > I'm trying to rebuild it manually, but my question is: all the
    > users that has already my app in their Applications folder ... how
    > can they upgrade their launcheservices database after download the
    > new version of my app?

    It should just work... the act of copying the application onto their
    system should cause it to be registered.

    I think in your playing around with your plist you may have gotta
    launch services confused about your application. It could be that you
    have multiple copies of you application with different version
    information and creation dates, etc. that is causing a conflict in
    launch services. You could try (for your local system) changing the
    bundle identifier for you application to see if it gets cleanly
    picked up by launch services.

    -Shawn
  • On Nov 2, 2006, at 11:02 AM, Yorh wrote:

    > Hi Shawn,
    >
    > Thank you for help
    > I'm trying my app both on Tiger PPC and Macbook pro (intel), both
    > of them doesn't upgrade launchservices database....
    >
    > Cannot really understand why.
    >
    > I'm trying to rebuild it manually, but my question is: all the
    > users that has already my app in their Applications folder ... how
    > can they upgrade their launcheservices database after download the
    > new version of my app?

    LS seems to have problems primarily when you move your app into /
    Applications from a build folder on the same volume.

    Other types of installs seem to be more reliable - copying (as
    opposed to moving) from the build folder, from another volume, or
    from a mounted DMG for instance, don't appear to have the same issue.

    In other words, it's primarily a problem that bites developers; I've
    rarely heard of it affecting end users.

    sherm--

    Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    Cocoa programming in Perl: http://camelbones.sourceforge.net
  • So....

    What have I to do?
    I tried to copy my app from the build folder to my applications
    folder but it doesn't work....

    thank you all
    Yorh

    On Nov 2, 2006, at 5:13 PM, Sherm Pendley wrote:

    > On Nov 2, 2006, at 11:02 AM, Yorh wrote:
    >
    >> Hi Shawn,
    >>
    >> Thank you for help
    >> I'm trying my app both on Tiger PPC and Macbook pro (intel), both
    >> of them doesn't upgrade launchservices database....
    >>
    >> Cannot really understand why.
    >>
    >> I'm trying to rebuild it manually, but my question is: all the
    >> users that has already my app in their Applications folder ... how
    >> can they upgrade their launcheservices database after download the
    >> new version of my app?
    >
    > LS seems to have problems primarily when you move your app into /
    > Applications from a build folder on the same volume.
    >
    > Other types of installs seem to be more reliable - copying (as
    > opposed to moving) from the build folder, from another volume, or
    > from a mounted DMG for instance, don't appear to have the same issue.
    >
    > In other words, it's primarily a problem that bites developers;
    > I've rarely heard of it affecting end users.
    >
    > sherm--
    >
    > Web Hosting by West Virginians, for West Virginians: http://wv-www.net
    > Cocoa programming in Perl: http://camelbones.sourceforge.net
    >
    >
  • Hi to all,

    Does anyone is able to send me a very basic example (an empty
    project), with this function?
    I will try on my mac ...

    Thank you all
    Yorh

    On Nov 2, 2006, at 5:46 PM, Yorh wrote:

    > So....
    >
    > What have I to do?
    > I tried to copy my app from the build folder to my applications
    > folder but it doesn't work....
    >
    > thank you all
    > Yorh
    >
    > On Nov 2, 2006, at 5:13 PM, Sherm Pendley wrote:
    >
    >> On Nov 2, 2006, at 11:02 AM, Yorh wrote:
    >>
    >>> Hi Shawn,
    >>>
    >>> Thank you for help
    >>> I'm trying my app both on Tiger PPC and Macbook pro (intel), both
    >>> of them doesn't upgrade launchservices database....
    >>>
    >>> Cannot really understand why.
    >>>
    >>> I'm trying to rebuild it manually, but my question is: all the
    >>> users that has already my app in their Applications folder ...
    >>> how can they upgrade their launcheservices database after
    >>> download the new version of my app?
    >>
    >> LS seems to have problems primarily when you move your app into /
    >> Applications from a build folder on the same volume.
    >>
    >> Other types of installs seem to be more reliable - copying (as
    >> opposed to moving) from the build folder, from another volume, or
    >> from a mounted DMG for instance, don't appear to have the same issue.
    >>
    >> In other words, it's primarily a problem that bites developers;
    >> I've rarely heard of it affecting end users.
    >>
    >> sherm--
    >>
    >> Web Hosting by West Virginians, for West Virginians: http://wv-
    >> www.net
    >> Cocoa programming in Perl: http://camelbones.sourceforge.net
    >>
    >>
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/list%
    > 40metagraphics.it
    >
    > This email sent to <list...>
  • On 11/2/06, Yorh <list...> wrote:
    > Hi to all,
    >
    > Does anyone is able to send me a very basic example (an empty
    > project), with this function?
    > I will try on my mac ...

    The following works for me... all I need to do after building the
    application is run it once by double clicking it (developer only issue
    since user copying it onto their systems should trigger automatic
    registration). Then I can type Foo://blah/blah/blah and my application
    gets launched and can display the URL.

    (working on an example project that I can provide to the public...)

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
    "">
    <plist version="1.0">
    <dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDocumentTypes</key>
    <array/>
    <key>CFBundleExecutable</key>
    <string>Foo</string>
    <key>CFBundleIconFile</key>
    <string>AppIcon</string>
    <key>CFBundleIdentifier</key>
    <string>com.bar.foo</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>NSMainNibFile</key>
    <string>MainMenu</string>
    <key>NSPrincipalClass</key>
    <string>NSApplication</string>
    <key>CFBundleURLTypes</key>
    <array>
      <dict>
      <key>CFBundleURLIconFile</key>
      <string>URLIcon</string>
      <key>CFBundleURLName</key>
      <string>Foo URL</string>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>Foo</string>
      </array>
      </dict>
    </array>
    </dict>
    </plist>

    Then in my app delgate...

    - (void)applicationWillFinishLaunching:(NSNotification *)aNotification
    {
    NSAppleEventManager *appleEventManager = [NSAppleEventManager
    sharedAppleEventManager];

    // Get URL Apple Event ('GURL') is part of the internet AE suite not
    the standard AE suite and
    // it isn't currently supported directly via a application delegate
    method so we have to register
    // an AE event handler for it.
    [appleEventManager setEventHandler:self
                       
        
    andSelector:@selector(handleGetURLEvent:withReplyEvent:)
                       
        forEventClass:'GURL'
          andEventID:'GURL'];
    }

    - (void)handleGetURLEvent:(NSAppleEventDescriptor *)event
    withReplyEvent:(NSAppleEventDescriptor *)replyEvent
    {
    NSLog(@"GURL = %@", event);

    NSAppleEventDescriptor* urlDescriptor = [event
    descriptorForKeyword:keyDirectObject];
    [self doSomethingWithURL:[NSURL URLWithString:[urlDescriptor
    stringValue]]];
    }

    -Shawn
  • On 11/2/06, Yorh <list...> wrote:
    > Hi to all,
    >
    > Does anyone is able to send me a very basic example (an empty
    > project), with this function?
    > I will try on my mac ...

    Try the following project...

    <http://homepage.mac.com/shawnce/misc/LaunchByUrl.zip>

    -Shawn
  • My understanding is that for security reasons, Safari only opens a
    specific set of helper applications. You can't get it to launch an app
    for a protocol like "aim:" if it doesn't already know that protocol
    and that app.

    So a link for iTunes works only because Apple wrote both iTunes and Safari.

    On 10/31/06, Yorh <list...> wrote:
    > Hi to all,
    >
    > I read one of my old post asking how to launch my application via
    > safari using link like aim: or similar.
    > I've found a file com.Apple.LauchServices.plist , but someone told me
    > to don't touch that file.
    > Anyway I saw that Adium for example, modify that file ....
    > How can I obtain the same result without editing that file?
    > Is there any documentation about it?
    >
    > thank you all for your kind support
    > Yorh
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/<keith.ray...>
    >
    > This email sent to <keith.ray...>
    >

    --

    C. Keith Ray
    <http://homepage.mac.com/keithray/blog/index.html>
    <http://homepage.mac.com/keithray/xpminifaq.html>
    <http://homepage.mac.com/keithray/resume2.html>
  • On 11/2/06, Shawn Erickson <shawnce...> wrote:
    > On 11/2/06, Yorh <list...> wrote:
    >> Hi to all,
    >>
    >> Does anyone is able to send me a very basic example (an empty
    >> project), with this function?
    >> I will try on my mac ...
    >
    > Try the following project...
    >
    > <http://homepage.mac.com/shawnce/misc/LaunchByUrl.zip>

    Oh... simply build it, run it manually once, quit out of it, then type
    in Safari "launchbyurl://test/test/test/test/test" and it should
    launch (likely after a security related dialog).

    -Shawn
  • Ok guys,

    I solved with the following tip ...
    I have a last question... now my app is launched but if I open my
    com.Apple.LauncheServices.plist I cannot find my app custom URL....
    Why??

    Thank you all!
    Yorh

    On Nov 2, 2006, at 6:57 PM, Shawn Erickson wrote:

    > On 11/2/06, Yorh <list...> wrote:
    >> Hi to all,
    >>
    >> Does anyone is able to send me a very basic example (an empty
    >> project), with this function?
    >> I will try on my mac ...
    >
    > The following works for me... all I need to do after building the
    > application is run it once by double clicking it (developer only issue
    > since user copying it onto their systems should trigger automatic
    > registration). Then I can type Foo://blah/blah/blah and my application
    > gets launched and can display the URL.
    >
    > (working on an example project that I can provide to the public...)
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
    > "">
    > <plist version="1.0">
    > <dict>
    > <key>CFBundleDevelopmentRegion</key>
    > <string>English</string>
    > <key>CFBundleDocumentTypes</key>
    > <array/>
    > <key>CFBundleExecutable</key>
    > <string>Foo</string>
    > <key>CFBundleIconFile</key>
    > <string>AppIcon</string>
    > <key>CFBundleIdentifier</key>
    > <string>com.bar.foo</string>
    > <key>CFBundleInfoDictionaryVersion</key>
    > <string>6.0</string>
    > <key>CFBundlePackageType</key>
    > <string>APPL</string>
    > <key>CFBundleSignature</key>
    > <string>????</string>
    > <key>CFBundleVersion</key>
    > <string>1</string>
    > <key>NSMainNibFile</key>
    > <string>MainMenu</string>
    > <key>NSPrincipalClass</key>
    > <string>NSApplication</string>
    > <key>CFBundleURLTypes</key>
    > <array>
    > <dict>
    > <key>CFBundleURLIconFile</key>
    > <string>URLIcon</string>
    > <key>CFBundleURLName</key>
    > <string>Foo URL</string>
    > <key>CFBundleURLSchemes</key>
    > <array>
    > <string>Foo</string>
    > </array>
    > </dict>
    > </array>
    > </dict>
    > </plist>
    >
    > Then in my app delgate...
    >
    > - (void)applicationWillFinishLaunching:(NSNotification *)aNotification
    > {
    > NSAppleEventManager *appleEventManager = [NSAppleEventManager
    > sharedAppleEventManager];
    >
    > // Get URL Apple Event ('GURL') is part of the internet AE suite not
    > the standard AE suite and
    > // it isn't currently supported directly via a application delegate
    > method so we have to register
    > // an AE event handler for it.
    > [appleEventManager setEventHandler:self
    > andSelector:@selector(handleGetURLEvent:withReplyEvent:)
    > forEventClass:'GURL'
    > andEventID:'GURL'];
    > }
    >
    > - (void)handleGetURLEvent:(NSAppleEventDescriptor *)event
    > withReplyEvent:(NSAppleEventDescriptor *)replyEvent
    > {
    > NSLog(@"GURL = %@", event);
    >
    > NSAppleEventDescriptor* urlDescriptor = [event
    > descriptorForKeyword:keyDirectObject];
    > [self doSomethingWithURL:[NSURL URLWithString:[urlDescriptor
    > stringValue]]];
    > }
    >
    > -Shawn
  • On 11/2/06, Keith Ray <keith.ray...> wrote:
    > My understanding is that for security reasons, Safari only opens a
    > specific set of helper applications. You can't get it to launch an app
    > for a protocol like "aim:" if it doesn't already know that protocol
    > and that app.

    Safari will use launch services to lookup and launch a URL protocol
    handler. If the user has never run the application that handles that
    URL themselves (by double clicking on it) then launch services will
    prompt the user to approve the action before launching it. See the
    following screen shot. If launch services believes the application has
    changed since it was run by the user it will show the dialog again.

    <http://homepage.mac.com/shawnce/misc/first_time_warning.png>

    -Shawn
  • erm, that's wrong I'm afraid.  I have successfully used this
    technique to add a custom URL scheme to one of my own apps and it
    works just fine.

    Mike.

    On 2 Nov 2006, at 18:14, Keith Ray wrote:

    > My understanding is that for security reasons, Safari only opens a
    > specific set of helper applications. You can't get it to launch an app
    > for a protocol like "aim:" if it doesn't already know that protocol
    > and that app.
    >
    > So a link for iTunes works only because Apple wrote both iTunes and
    > Safari.
    >
    > On 10/31/06, Yorh <list...> wrote:
    >> Hi to all,
    >>
    >> I read one of my old post asking how to launch my application via
    >> safari using link like aim: or similar.
    >> I've found a file com.Apple.LauchServices.plist , but someone told me
    >> to don't touch that file.
    >> Anyway I saw that Adium for example, modify that file ....
    >> How can I obtain the same result without editing that file?
    >> Is there any documentation about it?
    >>
    >> thank you all for your kind support
    >> Yorh
    >>
    >> _______________________________________________
    >> Do not post admin requests to the list. They will be ignored.
    >> Cocoa-dev mailing list      (<Cocoa-dev...>)
    >> Help/Unsubscribe/Update your Subscription:
    >> http://lists.apple.com/mailman/options/cocoa-dev/keith.ray%
    >> 40gmail.com
    >>
    >> This email sent to <keith.ray...>
    >>
    >
    >
    > --
    >
    > C. Keith Ray
    > <http://homepage.mac.com/keithray/blog/index.html>
    > <http://homepage.mac.com/keithray/xpminifaq.html>
    > <http://homepage.mac.com/keithray/resume2.html>
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Cocoa-dev mailing list      (<Cocoa-dev...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/cocoa-dev/mike.abdullah%
    > 40gmail.com
    >
    > This email sent to <mike.abdullah...>
  • On 11/2/06, Yorh <list...> wrote:
    > Ok guys,
    >
    > I solved with the following tip ...
    > I have a last question... now my app is launched but if I open my
    > com.Apple.LauncheServices.plist I cannot find my app custom URL....
    > Why??

    Never look in that file myself but if you do the following...

    "/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServices.framework/Support/lsregister
    -dump"

    ...I see the following listed in the output.

    bundle  id:            76608
            path:
    /Users/serickson/Development/_builds/Debug/LaunchByUrl.app
            name:          LaunchByUrl
            identifier:    com.yourcompany.LaunchByUrl
            version:      1
            mod date:      11/2/2006 10:21:24
            type code:    'APPL'
            creator code:  '????'
            sys version:  0
            flags:
            item flags:    container  package  application
    extension-hidden  native-app  ppc
            icon:
            executable:    Contents/MacOS/LaunchByUrl
            inode:        6668676
            exec inode:    6668691
            container id:  32
            library:
            library items:
            --------------------------------------------------------
            claim  id:            48076
                    name:          LaunchByUrl URL
                    role:          viewer
                    flags:
                    icon:          URLIcon
                    bindings:      launchbyurl:
  • You right,

    I saw it too!
    Cannot understand why AdiumX is listed in that file and my app not :(
    I will study the problem ....

    bye and thks
    Hope you will try my app!
    Yorh

    On Nov 2, 2006, at 7:30 PM, Shawn Erickson wrote:

    > On 11/2/06, Yorh <list...> wrote:
    >> Ok guys,
    >>
    >> I solved with the following tip ...
    >> I have a last question... now my app is launched but if I open my
    >> com.Apple.LauncheServices.plist I cannot find my app custom URL....
    >> Why??
    >
    > Never look in that file myself but if you do the following...
    >
    > "/System/Library/Frameworks/ApplicationServices.framework/
    > Frameworks/LaunchServices.framework/Support/lsregister
    > -dump"
    >
    > ...I see the following listed in the output.
    >
    > bundle  id:            76608
    > path:
    > /Users/serickson/Development/_builds/Debug/LaunchByUrl.app
    > name:          LaunchByUrl
    > identifier:    com.yourcompany.LaunchByUrl
    > version:      1
    > mod date:      11/2/2006 10:21:24
    > type code:    'APPL'
    > creator code:  '????'
    > sys version:  0
    > flags:
    > item flags:    container  package  application
    > extension-hidden  native-app  ppc
    > icon:
    > executable:    Contents/MacOS/LaunchByUrl
    > inode:        6668676
    > exec inode:    6668691
    > container id:  32
    > library:
    > library items:
    > --------------------------------------------------------
    > claim  id:            48076
    > name:          LaunchByUrl URL
    > role:          viewer
    > flags:
    > icon:          URLIcon
    > bindings:      launchbyurl:
  • On Thu, 2 Nov 2006 10:14:30 -0800, "Keith Ray" <keith.ray...> said:
    > My understanding is that for security reasons, Safari only opens a
    > specific set of helper applications. You can't get it to launch an app
    > for a protocol like "aim:" if it doesn't already know that protocol
    > and that app.
    >
    > So a link for iTunes works only because Apple wrote both iTunes and Safari.

    If a protocol like usrtlk: is 'like "aim:" then I've got a counterexample
    for you. m.

    --
    matt neuburg, phd = <matt...>, <http://www.tidbits.com/matt/>
    A fool + a tool + an autorelease pool = cool!
    AppleScript: the Definitive Guide - Second Edition!
    <http://www.amazon.com/gp/product/0596102119>
  • I believe I was confusing the way Apple Mail operates and Safari.

    Question:  If an email has a non-standard protocol link  like
    "usrtlk:" or "aim:" -- is it recognized as a link, and does clicking
    on that link launch an application?

    Does the mail message have to in HTML format as well?

    Does MacOS X 10.2 + Safari and Mail work like this?

    On 11/2/06, Matt Neuburg <matt...> wrote:
    > On Thu, 2 Nov 2006 10:14:30 -0800, "Keith Ray" <keith.ray...> said:
    >> My understanding is that for security reasons, Safari only opens a
    >> specific set of helper applications. You can't get it to launch an app
    >> for a protocol like "aim:" if it doesn't already know that protocol
    >> and that app.
    >>
    >> So a link for iTunes works only because Apple wrote both iTunes and Safari.
    >
    > If a protocol like usrtlk: is 'like "aim:" then I've got a counterexample
    > for you. m.
    >
    > --
    > matt neuburg, phd = <matt...>, <http://www.tidbits.com/matt/>
    > A fool + a tool + an autorelease pool = cool!
    > AppleScript: the Definitive Guide - Second Edition!
    > <http://www.amazon.com/gp/product/0596102119>
    >
    >
    >
    >

    --

    C. Keith Ray
    <http://homepage.mac.com/keithray/blog/index.html>
    <http://homepage.mac.com/keithray/xpminifaq.html>
    <http://homepage.mac.com/keithray/resume2.html>
  • Le 2 nov. 06 à 18:40, Yorh a écrit :

    > Does anyone is able to send me a very basic example (an empty
    > project), with this function?
    > I will try on my mac ...

    first may be i've misunderstood your question.

    in my case i've an app called "BookmarksMerge" (it's sleeping not
    released) able to merge bookmarks from any browser to any browser (on
    Mac OS X thought).

    this functionnality could be called from the browser itself, for
    example if in the browser's URL field you enter :

    "bmkm:fusiond"

    note bmkm is by analogy the "same" as man:ls you might use in Safari
    when you want to see the man page of ls into safari (thanks to sogudi).

    then, entering that in your browser window will launch my app
    "BookmarksMerge.app" with the correct setting.

    in short, if it's thi kind of behaviour you want, you have to provide :

    handleGetURLEvent(event)

    and also declare in your plist :

    <key>CFBundleURLTypes</key>
    <array>
      <dict>
      <key>CFBundleURLIconFile</key>
      <string>BookmarksMerge</string>
      <key>CFBundleURLName</key>
      <string>bmkm</string>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>bmkm</string>
      </array>
      </dict>
    </array>

    and leave all the browsers untouched except firefox where you have to
    register this new kink of URL...

    let me know if this answer to your question, i could help you further
    however keep in mond my app is written in RubyCocoa, then you would
    have to translate from rubycocoa dialect to ObjC one.

    for example here is the way we get an instance of NSAlert in
    rubycocoa dialect :


    @alert=OSX::NSAlert.alertWithMessageText_defaultButton_alternateButton_o
    therButton_informativeTextWithFormat("", "Valider", "Annuler", "", "")

    best,

    Yvon _______________________________________________
    Do not post admin requests to the list. They will be ignored.
    Cocoa-dev mailing list      (<Cocoa-dev...>)
    Help/Unsubscribe/Update your Subscription:
    http://lists.apple.com/mailman/options/cocoa-dev/<cocoa...>

    This email sent to <cocoa...>
previous month october 2006 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