Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: rebol protocol

From: bry:itnisk at: 13-Dec-2002 10:07

I haven't taken this any further yet, we're moving today so I probably won't have time to, and the reason why I'm working with this has nothing to do with Rebol, but since I have rebol in the back of my mind a lot lately when I started working with it I naturally thought it would be cool for Rebol. What's going on is that reb:c:\some.r won't load straight in rebol.exe, am uncertain why this should be since other exe's can be passed stuff this way. There's sure to be some underlying logic why this is, I have some ideas but don't want to express them yet as they are somewhat vague and undeveloped. This is why I have the test.r, so that rebol.exe loads test.r and test.r would then have code to interpret the argument which was passed it. For example if I have a link in a html page, like the following: <a href="reb:test this">test</a> then test.r receives the following commandline ["reb:test" "this"] one could obviously have a number of protocols, rebsite: which would take the argument and go to the index.r in View. reb-blocks: which would be used for passing in a block. And so forth. If you copy the following into a text file and save it with the .reg extension and click on it, it will add the proper stuff to your registry, you get the same stuff if you save export a registry key, for example look at the key nntp under HKEY_CLASS_ROOT/nntp, this tells windows how to handle the nntp protocol: This as a .reg file will add to the registry. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\reb] @="\"URL:Reb Protocol\"" URL Protocol ="" [HKEY_CLASSES_ROOT\reb\shell] [HKEY_CLASSES_ROOT\reb\shell\open] [HKEY_CLASSES_ROOT\reb\shell\open\command] @="c:\\rebol\\view\\rebol.exe test.r %1" as a general rule it's not considered good to use reg files anymore as they have no logic in them, so one should use wscript, but as I know what it is I want to do I'll just use the .reg file. Another interesting thing, in light of the stuff Rebol is especially good at if you look at HKEY_CLASS_ROOT/mailto this is what handles the mailto protocol. The @ is what puts it into the Default value. The protocol accepts reb: Reb:// will also be accepted of course as reb:// is contained in reb: right? Am uncertain exactly why this is, suppose it has to do with some weird thing in Urlmon.dll but don't intend to go look right now. About the question of using browse: If I use browse "reb:test this" I get ["reb://test" "this/"], if I use browse reb://c:\some.r?query=some.xml I get ["reb://c:\some.r/?query=some.xml"] as my commandline argument This seems good to me.