Getting command macro to repeat |
Post Reply |
Author | |
dtee
Member Joined: 14/Nov/2008 Status: Offline Points: 12 |
Post Options
Thanks(0)
Posted: 11/Jul/2009 at 7:17pm |
I bought WSRMacros: The User's Guide several days ago. It gets top marks from me as it has already helped me consolidate my hodgepodge of speech macros. Thank you for all the good work, Brad!
There is one thing I was hoping to find in the guide but did not, maybe because I don't know enough about programming to spot it. Is there a simple way to get a command macro to repeat X-number of times? Here is the simplest macro of this kind. I use it many times a week in Word 2007 outline mode: <!--This macro presses the tab key to change the current line to body-text level, moves the cursor down a line and to the end of the line in case there are more lines than one line requiring changing to body text--> <command> <listenFor>Body fast</listenFor> <sendKeys>{TAB}{DOWN}{END}</sendKeys> </command> Since I can see whether I need this to happen more than once, it would be nice to say, for example, Body fast 2 or 3 or whatever to get the whole job done with one utterance. Do I need to use CDATA and some visual basic code, or is there a still simpler way? Thanks and regards, Daniel |
|
mmarkoe
Moderator Group Joined: 24/Jul/2008 Status: Offline Points: 210 |
Post Options
Thanks(0)
|
Brad is pretty much totally involved in a new project so I wrote him privately with your request. He responded with:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> The SendKeys allows repeating with the times keyword: Or maybe something like this:
<emulateRecognition>Name of command macro to run</emulateRecognition> <emulateRecognition>Name of command macro to run</emulateRecognition> <emulateRecognition>Name of command macro to run</emulateRecognition> You may be able to fancy it up with a rule that listens for numbers too...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Hope this helps.
Marty
|
|
Marty Markoe, MVP
Microsoft Valued Partner See us at: http://www.mymsspeech.com |
|
dtee
Member Joined: 14/Nov/2008 Status: Offline Points: 12 |
Post Options
Thanks(0)
|
Hi Marty,
Thanks for passing this on. I'll try "times" tomorrow at work, see if it does the trick and report on the results here. Daniel |
|
dtee
Member Joined: 14/Nov/2008 Status: Offline Points: 12 |
Post Options
Thanks(0)
|
Well Marty,
It took me a bit longer to report back than I thought it would, but hopefully the wait was worth it . Adding the times = "[some number]" element to the sendKeys tag does the trick. Here it is: <speechMacros> <!--This speech macro, when used in Word's Outline View, will demote the current paragraph one level, and will repeat up to 6 times for successive paragraphs. I find this macro extremely useful in setting up newsletters since I use Outline View for quick formatting. The spoken variable [Reps], the <sendKeys times="{[Reps]}"> tag and the numbers-name tag are the key elements for getting the macro to repeat. What can be a spoken: "Body fast one", "Body fast two", etc., up to "Body fast six". This approach could be used to repeat any combination of keys inside the sendKeys tags.--> <command> <listenFor>Body fast [Reps]</listenFor> <sendKeys times="{[Reps]}">{TAB}{DOWN}{END}</sendKeys> </command> <numbers name="Reps" start="1" stop="6"/> </speechMacros> Best regards and thanks to you and Brad, Daniel |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |