Commands Purely for Fun and Entertainment
There is no question that some of the fun of using Dragon NaturallySpeaking is the simple fun of talking and seeing something happen. After all, where else in life are our wishes and commands so quickly and consistently tended to??
Here are a few commands that in my mind come under the category of fun and entertainment, rather than absolute functionality or productivity enhancers. I'd love to expand this collection, so if you have some similarly oriented commands, please send them my way. I should mention that none of these are of my own making and were collected from contributions made to on-line forums, such as Knowbrainer. Whenever possible, I will attempt to credit the author.
Date and Time Related Commands
These three commands are all Advanced Scripting commands and have the date, time or both spoken to you in computer synthesized speech. Date Please
Sub Main
SetMicrophone 0
TTSPlayString Format(Now, "dddd mmmm d yyyy"), "/s150 /p90"
SetMicrophone 1
End Sub
Time Please
Sub Main
SetMicrophone 0
TTSPlayString Format(Now, "h:mmAM/PM"), "/s150 /p90"
SetMicrophone 1
End Sub
Time and Date Please
Sub Main
SetMicrophone 0
TTSPlayString Format(Now, "h:mmAM/PM dddd mmmm d yyyy"), "/s150 /p90"
SetMicrophone 1
End Sub
Browser Zoom In and Zoom Out Commands
These two commands work in your internet browser (I've only tested them in Internet Explorer) and upon your command make you window appear larger or smaller.
Zoom In
Sub Main
SendKeys "%d",1
Wait .1
SendDragonKeys "javascript:void(s=document.body.style);void(z=s.getAttribute('zoom'));if(z){s.setAttribute('zoom',(parseInt(z)+50)+'%');}else s.setAttribute('zoom','150%')"
Wait .1
SendKeys "~"
End Sub
Zoom Out
Sub Main
SendKeys "%d",1
Wait .1
SendDragonKeys "javascript:void(s=document.body.style);void(z=s.getAttribute('zoom'));if(z){s.setAttribute('zoom',(parseInt(z)-50)+'%');}else s.setAttribute('zoom','50%')"
Wait .1
SendKeys "~"
End Sub
Window Control Commands
Perhaps more practical than entertaining, these three commands change the size/availability status of an active window. All three are presented in a Legacy or DVC format, so constructing a command using these involves taking an existing DVC command, copying it, renaming it, and using the demonstrated language for the script content. Minimize
SendSystemKeys "{Alt+Space}n"
ButtonClick 1,2
Sendkeys "{esc}"
Maximize
SendKeys "{Alt+Space}x"
Restore
SendKeys "{Alt+Space}r"
Window Movement and Resizing
These two commands were kindly provided by Philip Gilman and allow you to move or resize windows with simple verbal commands. They are both advanced scripting commands.
<move_window><direction_a_lot>
[This command moves your active window left, right, up or down and in varying magnitudes. The command is initiated by saying either "move window" or simply "window", followed by a direction (left, right, up, down) and optionally a magnitude (a lot).
Download Command
Sub Main
SendKeys "% m", True ' focus on title bar
diramt = 4 ' unit number of arrow presses
'
' First test for "a lot"
If InStr(ListVar2,"a lot") > 0 Then
diramt = diramt * 4 ' multiplier for "a lot"
' and pull out just the arrow direction
sndkeystr$ = Left$(ListVar2,(InStr(ListVar2,"a lot")-2))
Else ' not "a lot"
sndkeystr$ = ListVar2
End If
sndkeystr$ = "{" + sndkeystr$ +"}" ' finish formatting {arrow} direction
For i = 1 To diramt
SendKeys sndkeystr$, True
Next i ' press {arrow} key "diramt" times
SendKeys "~", True ' finish by pressing enter
End Sub
This command requires the following two lists:
<move_window>
' move window
' window
' <direction_a_lot>
' down
' down a lot
' left
' left a lot
' right
' right a lot
' up
' up a lot
<Make_Window><smaller_larger>
This commands makes your active window smaller or larger on your command. Like the prior command it is an "Advanced Scripting" command that you can import directly into your copy of Dragon Professional, legal or medical.
Download Command
' <make_window> <smaller_larger>
'
' the directions include bigger (larger), smaller, wider, narrower, taller, shorter
' and can include "a lot", "much" and "very much" as multipliers
'
' Examples:
' make window smaller, make window much smaller, make window very much smaller
' window size wider, window size a lot wider, window size very much wider
'
Sub Main
SendKeys "% s{right}{down}", True ' focus on lower right corner
'
diramt = 4 ' this is the unit number of {arrow} movements
If InStr(ListVar2,"much") > 0 _
Or InStr(ListVar2,"a lot") > 0 Then _
diramt = diramt * 4 ' multiplier for adding "a lot" or "much"
If InStr(ListVar2,"very") > 0 Then _
diramt = diramt * 2 ' "very" additional multiplier
'
' This "single line if block" picks the {arrow} direction
If InStr(ListVar2,"bigger") > 0 _
Or InStr(ListVar2,"larger") > 0 Then _
sndkeystr$ = "{Right}{Down}"
If InStr(ListVar2,"smaller") > 0 Then _
sndkeystr$ = "{Left}{Up}"
If InStr(ListVar2,"wider") > 0 Then _
sndkeystr$ = "{Right}"
If InStr(ListVar2,"narrower") > 0 Then _
sndkeystr$ = "{Left}"
If InStr(ListVar2,"taller") > 0 Then _
sndkeystr$ = "{Down}"
If InStr(ListVar2,"shorter") > 0 Then _
sndkeystr$ = "{Up}"
'
For i = 1 To diramt
SendKeys sndkeystr$, True
Next i ' press "{arrow}" key(s) "diramt" times
'
SendKeys "~", True ' finish up by pressing enter
'
End Sub
' <make_window>
' make window
' size window
' window
' window size
'
' <smaller_larger>
' a lot bigger
' a lot larger
' a lot narrower
' a lot shorter
' a lot smaller
' a lot taller
' a lot wider
' bigger
' larger
' much bigger
' much larger
' much narrower
' much shorter
' much smaller
' much taller
' much wider
' narrower
' shorter
' smaller
' taller
' very much bigger
' very much larger
' very much narrower
' very much shorter
' very much smaller
' very much taller
' very much wider
' wider
 |