GeekQuestion: How to register an URL type with an OS?

My operating system (MacOS 9 at the moment) knows what to do with a URL that starts off like this:

http://something.etc/morestuff

or like this:

mailto:somebody@example.com

or like this:

ftp://username:password@someserver.ip/folder

or like this:

news:alt.something.somethingmorespecific.crap

…and yours probably does, too. That is, you can click on any of those links regardless of whether the links themselves are on a web page, in an email message, or even in a word processing document if your wordprocessor is URL-aware, and your OS figures out what application to throw the address at.

With the installation of FileMaker 5.5, my OS acquired a new URL type. I can put this on my home page:

FMP5://password@IPorDomain/databasename.fp5

and if you have FileMaker installed and you click it, your browser will tell your OS, which will know to hand it off to FileMaker and the database opens. Cool, yes? OK, now my question:

via what procedure might I teach a given operating system about a new URL type?

Suppose for example that I want to write something like this:

ICQ://ICQdigits:ThisIsWhatIWannaSay

and have it be true that when I click on it, it passes the instruction to the OS which passes it on to ICQ, which opens addressed to the designated addressee (ICQdigits) with the text indicated (“ThisIsWhatIWannaSay”). How would I train my OS to do that?

Hmmph.

[QUOTE]
[url ]ftp://username :stickouttongue: assword@someserver.ip/folder[ /url]

Stupid smilies!

That should of course be
ftp://username:password@someserver.ip/folder

I’m sure it depends on the OS.

In Windows, there are keys in the Registry that keep track of this type of information.

They are in HKEY_CLASSES_ROOT. Each entry (for example, the “mailto” key in HKEY_CLASSES_ROOT) has a subkey called “shell”, which has a subkey called “open”, which has a subkey called “command” which holds the path to the program that the information in the protocal is sent to.

An example:
HKEY_CLASSES_ROOT\ftp\shell\open\command
has the value



"C:\Program Files\Internet Explorer\iexplore.exe" %1


on my machine.

There are a few more keys you may want under Windows, especially if you want to open the URL in an instance of your app that’s already running… my complete key looks like this (where @ is the default value):


[HKEY_CLASSES_ROOT\irc]
@="URL:IRC Protocol"
URL Protocol=""

[HKEY_CLASSES_ROOT\irc\shell\open\command]
@="c:\program files\virc\virc.exe"

[HKEY_CLASSES_ROOT\irc\shell\open\ddeexec]
@="irchyperlink %1"

[HKEY_CLASSES_ROOT\irc\shell\open\ddeexec\Application]
@="ViRC"

[HKEY_CLASSES_ROOT\irc\shell\open\ddeexec\Topic]
@="IRC_Execute"

I believe the “URL:IRC Protocol” and “URL Protocol” bits are necessary for Windows to realize you’re defining a new URL protocol. The ddeexec section tells Windows to start the program (virc.exe) only if it isn’t already running, and then to send the DDE macro “irchyperlink %1” to the application “ViRC” using the topic name “IRC_Execute”.

I have no idea how this translates to MacOS, though… sorry for the hijack. :wink:

Okay…I’m running Mac OS X (10.1.3) but ventured into Classic Mode (9.2) to find the answer to your question. You’ll need to open your Internet Control Panel. Click on the Advanced tab. On the left side of the dialog box, you’ll see a list of options. Click on Helper Apps. You’ll see a box called Helper Application Assignments. Click inside that box (the edges of it will turn to whatever your highlight color is set to, indicating that it is active). Then click the Add… button. A window will pop up called “New Helper Application”. Enter icq for the type and whatever you want for the description (that part is only for humans) and then click Select to browse to your ICQ application. Click Select, then OK.

To test all this, I went to Internet Explorer (still in OS 9), typed icq://[random numbers since I don’t use ICQ] and hit Return. My ICQ program (that I never use) did open…what would happen after that with a real number, I don’t know. Play with it and let me know what happens… :slight_smile: