One of biggest pains when writing a new DQSD search is massaging the correct HTML FORM into well-formed XML. I finally got annoyed enough to
write a little utility to do some of the work for me. I call it Dave's Quick Search Deskbar Search Wizard.
What does it do and why would I want to use it?
In a nutshell, it generates a DQSD search from the page currently displayed in your browser.
If you have no desire to ever write a search for DQSD, then don't read any further. If you do write searches from time to time, or at least want to, then you may find the wizard useful.
The first thing I typically do when creating a new search is to view the source for the page and strip out everything but the FORM for the search. This is tedious. And, often it's hard to find the right FORM when there are multiple FORMs in the page. Also, the process of converting the FORM's HTML to well-formed XML is error-prone (I always forget to close the INPUT elements with "/>"). There had to be an easier way.
If you don't, simply right-click on the IE toolbar, and click 'Customize...'. Add the button labeled "DQSD Search Wizard" in the list of available toolbar buttons.
Go to the web page containing the search you want to add to DQSD.
Click in the field that contains the search string.
Start up the wizard by clicking on its Internet Explorer toolbar button.
You should see a dialog that looks something like the following. Some of the fields will be automatically filled in. Enter an abbreviation and a title for the new search. The abbreviation is the string that will invoke the search and will be used for the file name, so keep it short and simple.
(Hold your cursor over the different fields to see their description.)
In the list of FORM elements, make sure at least one FORM is checked. If you clicked in a field before invoking the wizard, the FORM containing that field should be already be checked. Selecting a FORM in the list and expanding the dialog by clicking the HTML button will show the HTML content of the FORM. Selecting a FORM will also change the background and outline of the FORM on the web page in most cases. This is really just to provide some help in determining which FORM(s) you need include. You can check multiple FORMs, all of which will be included in the search file.
Hit OK and you'll be prompted to save the search file to your DQSD 'searches' directory.
After saving the file, it will come up in Notepad by default. (Click 'Options...' to change the editor to something other than Notepad.)
Example
In the screenshot above, I went to http://www.loc.gov (the US Library of Congress) and clicked in the search field...
Then I clicked the 'DQSD Search Wizard' button. All FORM elements in the page are listed (in this case only one), with the one checked that contains the 'active' element. I entered an abbreviation and a title (the title appears in the menu and help). Finally, I pressed 'OK' and I was prompted to save 'loc.xml' to the 'searches' subdirectory of my DQSD installation.
The resulting XML file search file will look something like the following. And, in spite of the comment at the top of the file, this search just works. Woo hoo! (Well, I find it fairly exciting.) Granted, complicated searches won't 'just work', but the wizard will at least do a bunch of the tedious work for you.