Hi Marty,
I am using Microsoft office 2007. The problem almost never occurs when using notepad or Microsoft Word. It occurs very very frequently in Windows Live Mail. The thread you mentioned was very helpful. I couldn't use the ALT-TAB approach though. A common situation is that I reply to incoming mails and switch to various other applications while writing my answer. So I cannot simply switch back to the previous application. I need to recognize the opened e-mail and paste my text there. The macro below does just that by looking for a window with a title including "Re: ". It works assuming there is only one open email at the time.
Thanks again for your help!
<speechMacros>
<!-- open e-mail dictation box --> <command> <listenFor>open email dictation box</listenFor> <sendKeys>{{CTRL}}a</sendKeys> <waitFor seconds=".25"/> <sendKeys>{{CTRL}}x</sendKeys> <waitFor seconds=".25"/> <run command="wordpad.exe" params=""/> <waitFor seconds="1"/> <sendKeys>{{CTRL}}v</sendKeys> <waitFor seconds=".25"/> <sendKeys>{{CTRL}}{Home}</sendKeys> <waitFor seconds=".25"/> <sendKeys>{Enter}{Enter}{{CTRL}}{Home}</sendKeys> <!-- Set the font to regular Verdana 10 pt --> <sendKeys>{{ALT}}i</sendKeys> <waitFor seconds=".25"/> <sendKeys>{Right}f</sendKeys> <waitFor seconds=".25"/> <sendKeys>Verdana{TAB}</sendKeys> <waitFor seconds=".25"/> <sendKeys>Regular{TAB}</sendKeys> <waitFor seconds=".25"/> <sendKeys>10</sendKeys> <waitFor seconds=".25"/> <sendKeys>{Enter}</sendKeys> <waitFor seconds=".25"/> <!-- maximize the window --> <sendKeys>{{ALT}} x</sendKeys> </command> <!-- post e-mail dictation --> <command> <listenFor>post email dictation</listenFor> <sendKeys>{{CTRL}}a</sendKeys> <waitFor seconds=".25"/> <sendKeys>{{CTRL}}c</sendKeys> <waitFor seconds=".25"/> <!-- switch to e-mail client --> <switchToApp windowTitleContains="Re: "/> <waitFor seconds="1"/> <sendKeys>{{CTRL}}v</sendKeys> <waitFor seconds=".25"/> <!-- Set the font of all text to regular Verdana 10 pt --> <sendKeys>{{CTRL}}a</sendKeys> <waitFor seconds=".25"/> <sendKeys>{{ALT}}i</sendKeys> <waitFor seconds=".25"/> <sendKeys>{Right}f</sendKeys> <waitFor seconds=".25"/> <sendKeys>Verdana{TAB}</sendKeys> <waitFor seconds=".25"/> <sendKeys>Regular{TAB}</sendKeys> <waitFor seconds=".25"/> <sendKeys>10</sendKeys> <waitFor seconds=".25"/> <sendKeys>{Enter}</sendKeys> <waitFor seconds=".5"/> <!-- position the cursor at the top --> <sendKeys>{{CTRL}}{Home}</sendKeys> <!-- switch back and clear --> <sendKeys>{{ALT}}{TAB}</sendKeys> <waitFor seconds=".5"/> <sendKeys>{{ALT}}{F4}</sendKeys> <sendKeys>n</sendKeys> </command>
</speechMacros>
|