Select Text, Open Background Tab, Search Website

Your approach is particularly nice if you want to search multiple sites. I do have a few suggestions:

  • It would be nice if the dialog included the selected text (or at least a substring).

  • You could have two triggers, the second being the first with an added modifier. If the second trigger was used, then the dialog could open with none of the sites checked (or maybe one, your favorite).

  • The technique you use to get the text is simple, but it does write over the current System Clipboard. You can restore the System Clipboard using:

I have a few macros that use the selected text, at least one of which uses the System Clipboard if no text is selected.

Originally I tried using the method you are using, but I found cases where it didn't work as expected. (No, I can't remember the specific circumstances. :thinking:) But I do remember working through this and developing a method that was more robust. If this is of any concern to you, check out the technique I use in:

The second one has the feature to use the System Clipboard if no text is selected.