Macro of the Day: Tell me the weather forecast for Redmond

Another good request for a macro came in the other day, this time from Brian (Thanks Brian). Here's what he wanted: A macro that can tell him the weather forecast.

Once you install this macro, you'll be able to say things like "What is the weather like in Redmond", or "Tell me the weather forecast for Redmond". It's only got a few cities in it right now, but you should be able to expand it to have as many cities as you care about.

The {[…]} part works but if say 3 words and then place them in google, the search string html is missing the "+’s" so instead you get three seperate google searches rather than one search with 3 words. I’m trying to figure out how to fix this but don’t see how yet.

I borrowed Rob’s temporary copy-to-clipboard / copy-back-from-clipboard [CDATA] to cure this, and for a few other reasons.

I utter (below) once the focus automatically enters the SearchValue field, at page load.

____

listenFor>Insert [something]</listenFor>

<script language="JScript">

<![CDATA[

// Copy the selected text into the clipboard and wait 1/4 second

Application.SendKeys("{250 WAIT}^c{250 WAIT}");

// Get the data out of the clipboard

var text = Application.clipboardData.getData("text");

]]>

</script>

I also use it because the wrong word string or phrase innocently dictated into the SearchValue box, can auto-fire a Google search for stuff you hadn’t finished saying, or non-related searches.

The [CDATA] copy/paste, above, cures that, too.

____

Further, if the user has the Google search bar installed, and/or has both Google & Live enabled in the browser’s native search box, uttering "Google Search" doesn’t necessarily click the [Google Search] button.

Sometimes this phrase will give numbers to different instances of the word Google everywhere on the page.

Ergo I use a macro called "look it up" that emulatesRecognition –>Press enter, and since the .insert[something]< used to the SearchVaue field, this command also *only fires the accordant Google search for the (up to 8) words inserted..

____

I’m sure it is the best solution, but for now it works 100% of the time.