FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

Using CLI to register an application to handle URIs

 
   Mac (Home) -> Programmer Help RSS
Related Topics:
Loading 2 libraries, getting 1 handle - I have the following I compile and link a Dynamic library and save it to disk as a.dylib. I now duplicate a.dylib and call the file b.dylib. I now run an that loads a.dylib by calling dlopen. The also loads..

resource fork handle! - Hi everybody ! I'm new to the mac And i need to access the resource handle, to fetch the text in the dialog. is used to get the resource handle. I'm aware of few APIs for similar work i.e.

How to notify event of one application to another applicat.. - Hi all Is there any way to catch click event when user open new folder? I want that my runs in when user click to open new folder, my notify about that event. So i can log that event and folder name and do other task. ..

How to start an application - yeah I know my question is stupid, but having a 20-year as a pc-user makes me a I wrote a 3D game using XCode with C++, OpenGL and SDL framework (I also use the FMOD .dylib). The program compiles, links and runs perfectly when I..

launch hidden application - I have a program on Windows which automates routine work. It makes use of different through COM (e.g. files to PDF through Acrobat Distiler) and it doesn't actually launch the I know it is..
Next:  Programmer Help: Delay help  
Author Message
Simon Slavin

External


Since: Aug 24, 2005
Posts: 113



(Msg. 1) Posted: Fri Jul 04, 2008 7:38 pm
Post subject: Using CLI to register an application to handle URIs
Archived from groups: comp>sys>mac>programmer>help (more info?)

I have invented a new kind of URI (don't ask) which looks something like
this:

<myURIType:resourcestring>

I need to be able to register my application to handle URIs of this type.
While testing I did this using the Preference Pane called 'More Internet'.
It worked fine. But I don't want to have to tell all my users to register
this preference pane.

I've looked at the documentation for Launch Services and it's all in
Carbon, and doesn't document how to set URI handlers. My handler is an
AppleScript and ideally I want to be able to set the handler for my type
of URI using a command line (trivial from AppleScript). Can URI handlers
be set this way ?

I've looked at com.apple.launchServices.plist, which I could edit very
easily using the 'defaults' command. But instead of a pointer to the
application it seems to have a dynamic string. I don't understand the
value of this string.

Simon.
--
http://www.hearsay.demon.co.uk
Back to top
Login to vote
Sherman Pendley

External


Since: Oct 31, 2007
Posts: 7



(Msg. 2) Posted: Fri Jul 04, 2008 7:38 pm
Post subject: Re: Using CLI to register an application to handle URIs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Simon Slavin <slavins.delete.these.four.words.TakeThisOut@hearsay.demon.co.uk>
writes:

> I have invented a new kind of URI (don't ask) which looks something like
> this:
>
> <myURIType:resourcestring>
>
> I need to be able to register my application to handle URIs of this
> type.

Add a CFBundleURLTypes key to your app's Info.plist. Launch Services
will parse it at the same time as it parses the CFBundleDocumentTypes
key.

Details:

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

sherm--

--
My blog: http://shermspace.blogspot.com
Cocoa programming in Perl: http://camelbones.sourceforge.net
Back to top
Login to vote
Simon Slavin

External


Since: Aug 24, 2005
Posts: 113



(Msg. 3) Posted: Sat Jul 05, 2008 2:18 am
Post subject: Re: Using CLI to register an application to handle URIs [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 04/07/2008, Simon Slavin wrote in
message
<g4lqs9$266$1$8300dec7@news.demon.co.uk>:

> I've looked at the documentation for Launch Services and it's all in
> Carbon, and doesn't document how to set URI handlers. My handler is an
> AppleScript and ideally I want to be able to set the handler for my type
> of URI using a command line (trivial from AppleScript). Can URI handlers
> be set this way ?

Sherman Pendley <spamtrap DeleteThis @dot-app.org> replied:

> Add a CFBundleURLTypes key to your app's Info.plist. Launch Services
> will parse it at the same time as it parses the CFBundleDocumentTypes
> key.

I had to add those types to the application after it was created. So the
application was right there, already parsed, and then I added the Types,
but that didn't make Launch Services parse the application again. So it
didn't work correctly for me.

But after reading your response I sent the application to a friend and it
worked for him without anything special. That's great. Thanks for your
help.

Simon.
--
http://www.hearsay.demon.co.uk
Back to top
Login to vote
Display posts from previous:   
       Mac (Home) -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
 Linux Forums
  Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact