Thanks a ton IaianB!
Riding on your script from Mouser, I made an ahk script to find Firefox, create a new tab, and open the search results:
...
_______________________________
-ottenm
I'm very pleased to see that it was of use/help.
I see that your nice and short script uses the AHK
InputBox, and is browser-specific.
I am always interested in trying out scripts and proggies to test them to see whether they do what they were intended/designed for, and what makes them fail, and what they do when they fail or are presented with input that was not necessarily intended in their design - for example, what they might do when things cause them to fail in some manner.
Testing a script under different conditions is useful, because the good/effective or bad things about a script might not always be immediately apparent. In the case of
Selectosurf some interesting points/features/possibilities are:
- 1. Housekeeping: The script makes a copy of the Clipboard current state before sending a copy command to capture the text highlighted by the user. At the end of the script, the saved clipboard state is replaced, overwriting any changes that the script may have made to the clipboard whilst the script was running. So you won't see the copied text in (for example) the CHS (Clipboard Help and Spell) list of recently copied text (it's called the "QuickPaste" list in CHS). It is good practice for a script to do some tidy up housekeeping after itself like this. But you might not want that. You might want to (say) keep any text you searched for, retained in QuickText. You can modify the script to do that by commenting out the housekeeping bits.
- 2. Browser: You can get it to use either the system default browser, or a specific browser which might not be the system default browser. This allows flexibility under the user's control.
- 3. Search engine: You have to specify the search engine in the parameters sent to the browser. This allows flexibility/choice under the user's control. However, you could modify this to just passing the assembled search text to the browser address bar ("awesome bar"), which could have been already set to apply that browser's default search engine to whatever was put in the address bar. More user choice.
- 4. Failure state: (Potentially very useful.) If the user does not select any text and presses the hotkeys to activate Selectosurf anyway, then the script does not fail (it makes a null copy capture) but picks up the last thing you happened to copy into the clipboard - could be an image or text, for example.
If you happen to be setting about collecting lots of material and references to search, then knowing this enables you to turn the combination of Selectosurf and CHS' QuickPaste (or whatever other Clipboard manager you might be using) into an incredibly useful. time-saving combination tool. You could go around copying the chunks of text - which may be either specific strings of text that you want to research or which may include some such specific strings in disconnected form. You can then select (click on) each item in turn from the CHS QuickPaste list and invoke Selectosurf in the usual way, for that item (ensure your mouse is not selecting any text at the time).
This works because selecting the item from the QuickPaste list pushes it into the Clipboard as "the last copied item", which is what Selectosurf falls back on when it makes a null copy capture (as above).
Before you do that though, if the item is a larger lump of text containing some text that would be irrelevant for a required search, then you can quickly edit it in CHS to reduce it to just that specific text string that you want to search for, and that goes into the QuickPaste list.
General note: You probably need to be mindful of whether you want the script to constrain the string to be an explicit literal field (inside double quotes):
e.g. something like:
theurl = http://duckduckgo.com/?q=`%22%theurl%`%22
or approximate (without quotes):
theurl = http://duckduckgo.com/?q=%theurl%
- when it is sent/put into the search box, as this will necessarily govern the outcome - i.e., the search result.
(After some experiment, I think I find the latter more useful.)
- 5. Autocopy: If you have Firefox, you can use the AutoCopy extension:
Select text on any web page and it will be automatically copied to the clipboard. It works in much the same way as does Trillian or mIrc.
Paste on middle click into textboxes, the url bar, and the search bar.
_______________________________________________
For capturing text strings containing more than one word, you have to select them all using the mouse, whereupon they are copied to the Clipboard.
For capturing text strings containing just one word, double-clicking on the single word selects and copies that single word to the Clipboard.
As above in point 4, if using (say) CHS:
You can then select (click on) each item in turn from the CHS QuickPaste list and invoke Selectosurf in the usual way, for that item. This works because selecting the item from the QuickPaste list pushes it into the Clipboard as "the last copied item". Before you do that though, if the item is a larger lump of text containing some text that would be irrelevant for a required search, then you can quickly edit it in CHS to reduce it to just that specific text string that you want to search for, and that goes into the QuickPaste list.
_____________________
With a clipboard manager such as (say) CHS, this can be very handy/speedy when gathering reference strings, as it puts them into the "latest captures" list - the QuickPaste list. If you select a string, using the mouse, and then invoke Selectosurf, the selected item goes into the Clipboard (and thus the CHS QuickPaste list) before Selectosurf saves the Clipboard state and makes its own copy of the selected item (which copy is later expunged when the script exits).
The degree of control possible over CHS puts the user in full control of using things like the QuickPaste list and even the content and order/sequence of items on it, making it an ideal tool for this sort of repetitive collection-and-research process.
I mention these points/features/possibilities because you describe your nice and short script as being derived from ("Riding on") the
Selectosurf script, and your script uses the AHK
InputBox, and is browser-specific.
The
InputBox could be an area for potential process improvement, by eliminating it altogether when/if it is redundant.
It thus occurred to me that you might be unaware of the above
Selectosurf points/features/possibilities. I imagined you
manually typing each search string (text item) into the
InputBox, and wondered how many times that might be repeated with different/new strings and how many hours that might consume over a researcher's lifetime, when one could perhaps easily automate the data capture aspect to a major extent, thus avoiding most/all of the manual input, and leaving you at liberty to use the freed up cognitive surplus for something more interesting/enjoyable.
So, just some thoughts. Hope they are not too jumbled.
I abhor using manual processes where automation can be more usefully applied, and I am often appalled when I come across some unnecessary and repetitive tedium that we have unwittingly imposed upon ourselves or others.
All kudos to
@mouser and his
Selectosurf and
CHS.