title: How to program a URL? (For search query)
body: <p>A co-worker of mine shared an autohotkey script (it's actually an exe file that runs on the background). Anyways, when I click the hotkeys it opens up a company webiste and creates a shared query for whatever's on the clipboard.  I was wondering how this is done and how I can make my own.<br>
  I'm specially curious about the "URL" modification that includes all these search options:</p>
  
  <pre><code>https://&lt;COMPANYWEBSITE&gt;/GotoDocumentSearch.do
  </code></pre>
  
  <p>That's the URL where I can search (sorry it's restricted and even if I link it you cant access it).<br>
  Anyways, after I set up all my options and stuff and click the search button I get the following URL:</p>
  
  <pre><code>https://&lt;COMPANYWEBSITE&gt;/DocumentSearch.do
  </code></pre>
  
  <p>I inspected the website source and this is the function that's called when I press the search button:</p>
  
  <pre><code>function preSubmitSearch(docPress) {
      document.pressed = docPress;
  
      // setup local doc types for submit by lopping over multi selects and building json data string
      var localDocTypesJson = "{";
      var sep = "";
      jQuery(".localTypeSel").each(function (i) {
          var selLocalTypes = jQuery(this).multiselect("getChecked");
          // get doc type code from id ex. 'localTypeSel_PD'
          //window.console.log("this.id=" + this.id);
          var tmpArr = this.id.split("_");
          var docTypeCode = tmpArr[1];
          var selLocalTypesCnt = selLocalTypes.length;
          if (selLocalTypesCnt &gt; 0) {
              var localTypes = "";
              var sep2 = "";
              for (var i2 = 0; i2 &lt; selLocalTypesCnt; i2++) {
                  localTypes += sep2 + "\"" + selLocalTypes[i2].value + "\"";
                  sep2 = ",";
              }
              localDocTypesJson += sep + "\"" + docTypeCode + "\": [" + localTypes + "]";
              sep = ",";
          }
      });
      localDocTypesJson += "}";
      jQuery("#localDocTypesJson").val(localDocTypesJson);
  }
  </code></pre>
  
  <p>HOWEVER, the working code that was shared with me (that was written ages ago by some employee who's not here anymore). Has the following URL when I use the autohotkey:  </p>
  
  <pre><code>https://&lt;COMPANYWEBSITE&gt;/DocumentSearch.do?searchType=all&amp;localDocTypesJson=7D&amp;formAction=search&amp;formInitialized=true&amp;searchResultsView=default&amp;btn_search=Search&amp;docName=*&lt;CLIPBOARD&gt;*&amp;wildcards=on&amp;docRevision=&amp;latestRevOnly=true&amp;docProjectNumber=&amp;docEngChangeOrder=&amp;docLocation=&amp;findLimit=500&amp;docTypes=Customer+Drawing&amp;docTypes=Production+Drawing&amp;docTypes=Manufacturing+Process+Document&amp;docTypes=Specification+Or+Standard
  </code></pre>
  
  <p>Note: replaced text with "CLIPBOARD" for clarification.<br>
  I was wondering if that's a type of "URL-programming" or how can I make a direct URL that prompts for the search results from the website? is that Javascript? or how is that programmed? (I know Swift and some Java, but have never really used Javascript).</p>