<search function="guidgen">
  <name>GUID Generator</name>
  <category>Computers<category>Programming</category></category>
  <contributor>Glenn Carr</contributor>
  <link></link>
  <email>glenn at glenncarr dot com</email>
  <description>
  Generate a GUID using the scriptlet.typelib ActiveX component.
    <div class="helpboxDescLabels">Switches:</div>
    <table class="helpboxDescTable">
      <tr><td>/dotnet</td><td> - </td><td>Generate a .NET compatible guid string</td></tr>
	</table>
    <div class="helpboxDescLabels">Examples:</div>
    <table class="helpboxDescTable">
      <tr><td>guidgen</td></tr>
      <tr><td>guidgen /d</td></tr>
    </table>
  </description>
  <script><![CDATA[
    function guidgen(q)
    {
			try
			{
				var dotNetMode = false;
				var args = parseArgs(q, "dotnet");
		        for (var i = 0; i < args.switches.length; i++) {
		          sw = args.switches[i];
				  switch(sw.name) {
				  case "dotnet": dotNetMode = true; break;
				  }
				}

				if (args.q != "") {
					nullArgs("guidgen","?");
					return false;
				}

				var guid = new ActiveXObject("scriptlet.typelib").guid.substr(0,38);
				if (dotNetMode) {
					guid = "[Guid(\"" + guid.replace(/[{}]/g, "") + "\")]";
				}
				setSearchWindowText(guid, true);
			}
			catch ( e )
			{
				alert( 'There was a problem creating the ActiveX component needed to generate GUID, or you simply need to click "Yes" in the dialog that pops up.  Reload the toolbar (type !) and try again.' );
			}
    }
  ]]></script>
  <copyright>
    The following applies if this file is included and distributed with Dave's Quick Search Deskbar:
    Copyright (c) 2002 David Bau; Distributed under the terms of the GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
  </copyright>
</search>
