dcandygmailcom

A internet search utility to make searching easier.

Feb 8th, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!-- One file follows -->
  2. <!-- Search.hta -->
  3. <!-- An Internet search utility -->
  4. <HTML>
  5. <HEAD><TITLE>Search</TITLE>
  6.   <HTA:APPLICATION ID="oMyApp"
  7.     APPLICATIONNAME="Search"
  8.     BORDER="normal"
  9.     BORDERSTYLE="sunken"
  10.     CONTEXTMENU="yes"
  11.     CAPTION="yes"
  12.     ICON="C:\windows\system32\shell32,-5"
  13.     SCROLL="no"
  14.     SHOWINTASKBAR="yes"
  15.     SINGLEINSTANCE="yes"
  16.     SYSMENU="yes"
  17.     WINDOWSTATE="normal"
  18.   />
  19.  
  20. <style>
  21. BODY  {font-size :100%;font-family: Arial, Helvetica, sans-serif;color: black;
  22.   background-color: ivory;
  23.   margin-top:10pt; margin-left:20pt; margin-right:10pt ; text-align:Justify}
  24. P  {margin-left:0pt;margin-right:0pt}
  25. </style>
  26.  
  27.  
  28.  
  29. <SCRIPT LANGUAGE="VBScript">
  30. Dim Searchterm
  31.  
  32. Sub Search
  33. '   On Error Resume Next
  34.     Set WshShell = CreateObject("WScript.Shell")
  35.     If tb2(6).Checked=True then WshShell.Run "https://www.google.com.au/search?q=site:stackoverflow.com+" & Replace(tb1.value, " ", "+")
  36.     If tb2(5).Checked=True then WshShell.Run "https://www.google.com.au/maps/place/" & Replace(tb1.value, " ", "+")
  37.     If tb2(4).Checked=True then WshShell.Run "https://www.google.com.au/search?q=" & Replace(tb1.value, " ", "+") & "&cr=countryAU"
  38.     If tb2(3).Checked=True then WshShell.Run "https://www.google.com.au/search?q=site:msdn.microsoft.com+" & Replace(tb1.value, " ", "+")
  39.     If tb2(2).Checked=True then WshShell.Run "https://www.google.com.au/search?q=nethack+" & Replace(tb1.value, " ", "+")
  40.     If tb2(1).Checked=True then WshShell.Run "https://en.wikipedia.org/wiki/" & tb1.value
  41.     If tb2(0).Checked=True then WshShell.Run "https://www.google.com.au/search?q=" & Replace(tb1.value, " ", "+")
  42.     If tb4.checked=false then WshShell.RegWrite "HKCU\Software\StackOverflow\VBS\Searchterm", tb1.value & vbtab & WshShell.RegRead("HKCU\Software\StackOverflow\VBS\Searchterm")
  43.     If tb3.checked=true then
  44.         window.close
  45.     Else
  46.         document.parentwindow.refresh
  47.     End If
  48. End Sub
  49.  
  50. Sub Init
  51.     Count = 0
  52.     window.resizeTo 600, 375
  53. '   On Error Resume Next
  54.     Set WshShell = CreateObject("WScript.Shell")
  55.     HistoryArr = Split(WshShell.RegRead("HKCU\Software\StackOverflow\VBS\Searchterm"), Chr(9))
  56.     If Not IsNull(HistoryArray) then tb1.value = HistoryArr(0)
  57.     For each t in HistoryArr
  58.         Count=Count + 1
  59.         Set Hist = document.createElement("OPTION")
  60.         Hist.Text=t
  61.         Hist.Value=Count
  62.         HistoryList.Add(Hist)
  63.         Count=Count + 1
  64.         If Count > 50 then exit For
  65.     next
  66.     tb1.select
  67. '   tb1.focus
  68. End Sub
  69.  
  70. Sub Paste
  71.     tb1.value=document.parentwindow.clipboardData.GetData("TEXT")
  72.     tb1.select
  73. End Sub
  74.  
  75. Sub LBTransfer
  76.     x = CLng(HistoryList.Options.selectedindex)
  77.     tb1.value = HistoryList.Options(x).text
  78.     tb1.select
  79. End Sub
  80.  
  81. Sub LBTransferK
  82.     x = CLng(HistoryList.Options.selectedindex)
  83.     tb1.value = HistoryList.Options(x).text
  84.     HistoryList.focus
  85. End Sub
  86. </script>
  87. </head>
  88.  
  89. <body Onload=Init>
  90. <p><b>Enter <u>s</u>earch term</b></p>
  91. <p><INPUT Name=tb1 TYPE=Text size=60 AccessKey=s> <INPUT NAME="Search" TYPE="SUBMIT" VALUE="Search" OnClick=Search></p>
  92. <p><INPUT Name=tb3 TYPE=CHECKBOX CHECKED AccessKey=c> <u>C</u>lose on search <INPUT Name=tb4 TYPE=CHECKBOX AccessKey=d> <u>D</u>on't save search term in history <a onclick=paste href=# AccessKey=p><u>P</u>aste clipboard</a></p>
  93.  
  94.  
  95. <p><b><u>H</u>istory</b></p>
  96. <p><SELECT NAME="HistoryList" SIZE="4" Onclick=LBTransfer OnKeyPress=LBTransferK AccessKey=h>
  97. </SELECT></p>
  98. <p><b>Search <u>w</u>here</b></p>
  99. <p><INPUT Name=tb2 TYPE=RADIO CHECKED AccessKey=w> Google <INPUT Name=tb2 TYPE=RADIO> Wikipedia <INPUT Name=tb2 TYPE=RADIO> Nethack <INPUT Name=tb2 TYPE=RADIO> MSDN <INPUT Name=tb2 TYPE=RADIO> Australia <INPUT Name=tb2 TYPE=RADIO> Maps <INPUT Name=tb2 TYPE=RADIO> Stack Overflow</p>
  100.  
  101.  
  102.  
  103. </body>
  104. </html>
Advertisement
Add Comment
Please, Sign In to add comment