13.0

Table Of Contents
Chapter 11: Commands that perform actions based on the application state
GroceryListSample_WordPad
GroceryListSample_WordPad.xmlcontainsAdvancedScriptingcommandssimilarto
thoseofGroceryListSample_DragonPad.xml.Itdemonstrateshowtosetandchange
commandstatesandtousethecommandpromptinWordPadandusesadifferent
codingstyle.Thesamevoicecommand"PrepareGroceryList"willstartthegrocerylist
inWordPad,activatetheinitialgroceryliststate,andprompttheuserwithasetof
grocerylistcommandsthatareactiveinthegivenstate.Toreadmoreaboutthissample
anditscommands,refertothecodecommentsintheXMLfile.
SampleBoilerPlate_ColonCancer
SampleBoilerPlate_ColonCancer.xmlcontainsAdvancedScriptingcommandsthat
demonstratehowtousestructuredcommandsandthecommandpromptforboilerplate
text.Thissampleismodeledafteracoloncancerchecklistandisdesignedtoworkin
MicrosoftWord.Thevoicecommand"ColonCancerChecklist"causestheboilerplate
texttodisplayandtakestheuser,fieldbyfield,throughthechecklist.
SampleBoilerPlate_EndoBiopsy
SampleBoilerPlate_EndoBiopsy.xmlcontainsasingleAdvancedScriptingmacrothat
demonstrateshowtosetupboilerplatetextandusethecommandprompttoguideusers
infillingtheboilerplatetextwithoutusingstates.Thissampleismodeledafteran
endoscopicbiopsyreportandisdesignedtoworkinMicrosoftWord2003or2007.The
voicecommand"PrepareEndoscopicBiopsyGrossTemplate"causestheboilerplate
texttodisplayandtakestheuser,fieldbyfield,throughthereport.
SampleTGV_Restaurant
SampleTGV_Restaurant.xmlcontainsTextandGraphicsandAdvancedScripting
commandsthatareusedinDragonPadtosimulateanorderingsystemforaChinese
andJapaneserestaurant.Thissampledemonstrateshowtosetstatesforstructured
commandsaswellashowthesamecommandscanbeusedtoproducedifferentresults
indifferentstates.Thevoicecommand"ChineseMenu"or"JapaneseMenu"startsthe
orderingsystemandactivatesthestructuredcommandscreatedforthegivenstate.The
voicecommand"ExitOrderingSystem"endstheorderingsession.
SetStateSample
SetStateSample.xmlcontainssimpleTextandGraphicscommandsthatdemonstrate
howtousevariablesandtextformatsandAdvancedScriptingcommandstosetand
unsetacommandstate.ThissampleisdesignedtoworkinDragonPadwiththeinitial
command"SampleSetState."Whenthecommandexecutes,acommandstateisset
forDragonPadandasimpleexchangeofgreetingsissimulatedbetweentheuserand
thesystem.Theuserspeaksthegreeting,e.g."GoodMorning",andthesystem
respondsinboldredtext.Whentheusersays"Good-bye",theexchangeisterminated
andthecommandstateisunset.
SampleInjuryReport
SampleInjuryReport.xmltogetherwithSampleInjuryReport.dotdemonstrateshow
structuredcommandsandMicrosoftWordtemplatescanbeusedtogethertocreatea
voice-enabledformfillingenvironment.Thetemplateisamockinjuryreportwithseveral
textandcheckboxfieldscanbefilledusingthecommandsincludedintheXMLfile.You
startaformfillingsessionwiththevoicecommand"EditReport"spokeninanew
270