views:

17

answers:

1

I was wondering is it possible to create a web link so that when a user click's on it, it will open up a OSX application - How could I make like in terminal - open myapp.app

Or am I violating some OSX rule?

+1  A: 

If you want to open your app, one way is to make your app handle a URL scheme, say x-my-app-scheme://. This can be done following the methods described in this Apple document. You also need to set CFBundleURLTypes in your Info.plist, as described there. Then in your web page, make an href to x-my-app-scheme://foo.

You can't open an arbitrary app from a link in a web site. That would be a grave security hole; consider using that behavior from a Javascript.

Yuji
Although that security hole has happened in the past (wasn't there some issue involving 'file' links where you could run arbitrary apps by making a good guess about the users file system. Fixed by deprecating file links from remote servers).
JulesLt
In fact custom URL schemes also caused security holes in the past, when the URL is inordinately expressive. One example was the help viewer; its custom scheme allowed one to execute arbitrary Applescript. Ugh!
Yuji
Perfect thanks for the input.
tspore