AutoHotkey Community

It is currently May 26th, 2012, 6:20 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: DragonPad²
PostPosted: February 11th, 2009, 8:13 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
The overall purpose of this program is to extend the potential of Dragon Naturally Speaking, to dictate with DNS at a higher speed. and to provide an alternative way of sending commands, including "text commands" without the 1/2-second pause you always get with Dragon while it executes a command. (Or at least you do with the Preferred version. I can't speak to the "Pro" version.) And of course, like Dragon's own DragonPad, another important use of this program is to allow one to dictate freely to programs that are not "select and say compliant," which is pretty much anything but Windows native applications and WordPerfect, and Mozilla. Using this program, for instance, I can now dictate to my favorite text editor, Textpad. I could not before, except by using DragonPad, which is as feature-rich as it was back in Dragon ver. 8 . . . So it goes I guess.

I've done some much needed improvements to my little DragonPad² project, and I think it works much better now. And for demonstration purposes, this script now sends its text to notepad, so it should be easier for anybody to try it quickly and easily.

The basic idea is this: You dictate to Dragon, and set the focus on DragonPad². It copies any newly-dictated text in its edit box to a variable, and then reads that variable, passing any text to (in this case) Notepad. In the event that variable contains any word that's been designated as a command, it executes that command instead of passing it through as text.

It performs this way either on a one-time basis that you can repeat as desired (which has a couple of uses outside of Dragon dictation) or on a regular timed basis, where it checks the edit field every 250ms, and if it finds it isn't empty, performs the function and then loops back again.

All text dictated to DragonPad² is both appended to a timestamped logfile, and to a variable. The var is gone when you stop the timed cutnpaste, and the logfile remains.

You can assign any word whatsoever to an AHK command, by adding it to the command list, and creating a gosub for that command. See the example script. When Dragon types the command into DragonPad2, said command is executed.

Additional features include :

* all text from edit field being appended to a textfile, with timestamps.
* Numerical stamps or optionally timestamps appended to any command. See my examples.
* the timed cutnpaste functiion does not remove text from the DragonPad² edit field, so you can go back and use Dragon to correct any errors, thereby training Dragon.
* Built in timer and word count display.
* Works with any version of DNS and probably ViaVoice too. I haven't busted out the ViaVoice for a few years.

Usage:

Quick demo:

Start the script, go through the textfile creation dialog (in a hurry you can just keep pressing escape and it will do it all for you.) It will create a file called deleme.txt and open it in Notepad. If not, you need to do this yourself. Then press rctrl-numpad2 to activate DragonPad², and type or dictate some words and then @1 @2 @3 @4 @5 @6 into DragonPad² and then hit Ctrl-numpad0. Watch it work, and then press f4. Take a look at the results.

Or the long version:

Start the script. You should have no problem if you compile it, either. It will open a dialog to create a backup textfile. Eiher name the textfile or let it do that for you. The default is activedir/%A_MM%-%A_DD%-%A_Hour%-%A_Min%.txt
DragonPad² will also open an instance of notepad, and create a file named deleme.txt for it to dictate to by default. You can easily reconfigure it to send to any other word processor instead.

Activate DragonPad² by selecting it or by pressing Ctrl-1 or Ctrl-2. Ctrl-1 displays a messagebox reminding you to do whatever you need to before dictating, such as putting Dragon in "dictate" mode (highly recommended).

Start the timer by pressing the "start" button. When ready to dictate, press "timedcutnpaste" on the menu bar, or else press Ctrl-numpad0.

When DragonPad² has focus, you can dictate directly into it, and any command on the commandlist will be executed as a command instead of passed through as text. I have created 6 examples: @1,@2,@3,@4,@5,@6, and each one demonstrates a couple built-in features and limitations of this program.

When you want to pause DragonPad² you can either press "pause" or f4, or on the menubar, select actions>stoptimedcutnpaste. There will be a brief pause, and then everything you have dictated to it will display in the edit field. To re-send it, re-start timed cutnpaste again. To clear it, press f5, or reload the script.

Train Dragon for a few words. Replace the words in the commandlist, add the desired commands in the gosub section, and test them. Standard AHK syntax rules here.

Problems/bugs:


* The word count includes spaces right now. I aim to fix this soon. Does not affect basic functioning in any way. -- I think maybe I just fixed this.

* Basically, DragonPad² was designed for being dictated to with Dragon, and so if you manually enter text, you may see some spurious results. Dragon sends words as whole words, so when dictating the timed cutnpaste will not send incomplete words -- not so for typing and timed cutnpaste. A simple solution if you are typing into it for some reason, like testing, is to use the cutnpaste that is not timed, when you are done typing. And several things you would normally type need to be sent in the form of commands instead.

* DragonPad2 will not pass through the symbols {,},^,+,#,!, and probably one or two others I've forgotten, as they are AHK code symbols and AHK reads them as such. The workaround for this was more extensive than I wanted to undertake so far. A number of simple workarounds are available but I didn't want to clutter up the demo version any worse than it is already.

* At present, DragonPad² is not good at reading and sending carriage returns. I don't anticipate dictating carriage returns, and so I didn't design it for that, but rather to strip out multiple spaces and/or carriage returns from all text. The correct way to send a CR in this script is to create a command for DragonPad² to execute a carriage return in the word processor that you are sending to, rather than in DragonPad² itself. That is to say, do not dictate "New Line" to DragonPad² but rather dictate some made-up word like "dookie" and create an entry in the commandlist, and create a command that looks like:

Code:
dookie:
Controlsend,Edit1,`n *Now we are on a new line*,deleme.txt - Notepad
Return


* Due to the current typing rate of my keyboard, I have been forced to use a setkeydelay setting of 1,1 which is pretty slow. At the default setting, there are errors and bad capitalizations. In all likelihood this will never be an issue when dictating, even at the setting of 1,1, because it's pretty rare that you will dictate that fast for any duration. And DragonPad² does keep it all in a buffer, so any lag in transmission between DragonPad² and your target word processor is not lost, even if you don't see it right away.


Todo:
Fix the word count -- may be fixed now.
Enable an accurate wpm counter -- Still needs doing, does not affect functionality
Rewrite the cutnpaste and timedcutnpaste so they do not cut text from the edit field, but rather read the last words entered. This is important. -- Fixed.
;-----------------------------------------------------

Code:
#Persistent
settimer, update_clock, 50
;return

; Grier = 1
Commandlist = @0,@1,@2,@3,@4,@5,@6
Wordcount = 0

; DragonPad2 -- FREEWARE by ribbet.1 and many others
; who have taught me mro provided code I've lifted from,
; most especially Chris and SKAN!

; You are free to distribute this script, modify or compile it, and MAY NOT CHARGE MONEY FOR IT! 

; A minor note of apology for my use of religious terminology for my variables.  I am very much in love with the dieties of the Hindu pantheon, and that is why I used them.  There is no offense intended.

; To add a new command you must type one in here. 
; Some characters are illegal and must be escaped or left unused, such as comma, pipe, or colon.

; This program is initially based on the 'simple text editor with menu bar,' provided at the ahk website, nothing more.

; Create the sub-menus for the menu bar:
DateTimeStamp=20061103000000
Menu, FileMenu, Add, &New, FileNew
Menu, FileMenu, Add, &Open, FileOpen
Menu, FileMenu, Add, &Save, FileSave
Menu, FileMenu, Add, Save &As, FileSaveAs
Menu, FileMenu, Add  ; Separator line.
Menu, FileMenu, Add, E&xit, FileExit
Menu, HelpMenu, Add, &About, HelpAbout
Menu, HelpMenu, Add, &Woids, Helpwords
Menu, ActionsMenu, Add, &TimedCutNpaste, TimedCutNpaste
Menu, ActionsMenu, Add, &STOPTimedCutNpaste -- F4, STOPTimedCutNpaste
Menu, ActionsMenu, Add, &SingleCutNpaste -- Ctrl-Shift-Win-v, SingleCutNpaste
Menu, MyMenuBar, Add, &File, :FileMenu
Menu, MyMenuBar, Add, &Help, :HelpMenu
Menu, MyMenuBar, Add, &Actions, :ActionsMenu
Menu, MyMenuBar, Add, &TimedCutNpaste, TimedCutNpaste

; Attach the menu bar to the window:
Gui, Menu, MyMenuBar

; Create the main Edit control and display the window:
Gui, +Resize -MaximizeBox  ; Make the window resizable.
;Gui, Add, Tab2,w600 h80,Main||Non-Main
Gui, Add,Edit,vMainEdit WantTab x10 y28 w600 h80
Gui, Add, Button, x326 y4 w50 h20 vStartStop gStartStop, Start
Gui, Add, Button, x376 y4 w50 h20 vPauseResume gPauseResume, Pause
Gui, Add, Button, x426 y4 w50 h20 vReset gReset, Reset
Gui, Add, Text, x508 y8 w50 h20 +Center, 00:00:00
Gui, Add, Text, x556 y8 w50 h20 +Center, 00:00:00
Gui, Add, Text, x256 y8 w90 h20, 0 Words

Gui, Font, S12 CDefault, Verdana
CurrentFiln =  ; Indicate that there is no current file.
Gui,Tab,2
;Gui, Add,Edit,vMainEdit2 WantTab x10 y28 w600 h80
Gui, Show,, DragonPad²
;return
;-----------------------------------------------------
; This simply creates a text editor to for DragonPad² to send text to.  You will probably want to replace it with your favorite text editor, such as Word, WP, Textpad, whatever floats your boat.
Fileappend, Created %A_MM%-%A_DD%-%A_Hour%-%A_Min%,deleme.txt
Sleep,500
Run, Notepad.exe deleme.txt
FileSelectFile,CurrentFiln
;-----------------------------------------------------
; This creates a textfile that all strings are sent to, as sort of a backup.  In the event DragonPad² has a problem, you can still have this, and in fact you can paste it into DragonPad² and send it to your text editor again.

If CurrentFiln =
{
CurrentFiln = %A_MM%-%A_DD%-%A_Hour%-%A_Min%.txt
Fileappend, Created %A_MM%-%A_DD%-%A_Hour%-%A_Min%`n,%CurrentFiln%
MsgBox,The literal textstrings are being saved to `n%A_Workingdir%\%CurrentFiln%`n
FullCurFiln = %A_Workingdir%\%CurrentFiln%
;MsgBox,%FullCurFiln%
WinActivate,DragonPad²
Return
}
Else
WinActivate,DragonPad²
Return 
;-----------------------------------------------------
FileNew:
GuiControl,, MainEdit  ; Clear the Edit control.
return
;-----------------------------------------------------
FileOpen:
Gui +OwnDialogs  ; Force the user to dismiss the FileSelectFile dialog before returning to the main window.
FileSelectFile, SelectedFileName, 3,, Open File, Text Documents (*.txt)
if SelectedFileName =  ; No file selected.
    return
Gosub FileRead
return
;-----------------------------------------------------
FileRead:  ; Caller has set the variable SelectedFileName for us.
FileRead, MainEdit, %SelectedFileName%  ; Read the file's contents into the variable.
if ErrorLevel
{
    MsgBox Could not open "%SelectedFileName%".
    return
}
GuiControl,, MainEdit, %MainEdit%  ; Put the text into the control.
FullCurFiln = %SelectedFileName%
Gui, Show,, DragonPad²   ; Show file name in title bar.
return

FileSave:
if FullCurFiln =   ; No filename selected yet, so do Save-As instead.
    Goto FileSaveAs
Gosub SaveCurrentFile
return
;-----------------------------------------------------
FileSaveAs:
Gui +OwnDialogs  ; Force the user to dismiss the FileSelectFile dialog before returning to the main window.
FileSelectFile, SelectedFileName, S16,, Save File, Text Documents (*.txt)
if SelectedFileName =  ; No file selected.
    return
FullCurFiln = %SelectedFileName%
Gosub SaveCurrentFile
return
;-----------------------------------------------------
SaveCurrentFile:  ; Caller has ensured that CurrentFiln is not blank.
IfExist %FullCurFiln%
{
    FileDelete %FullCurFiln%
    if ErrorLevel
    {
        MsgBox The attempt to overwrite "%FullCurFiln%" failed.
        return
    }
}


GuiControlGet, MainEdit  ; Retrieve the contents of the Edit control.
FileAppend, %MainEdit%, %FullCurFiln%  ; Save the contents to the file.
Gui, Show,, DragonPad²
return
;-----------------------------------------------------
HelpAbout:
Gui, 2:+owner1  ; Make the main window (Gui #1) the owner of the "about box" (Gui #2).
Gui +Disabled  ; Disable main window.
Gui, 2:Add, Text,, Text for about box.
Gui, 2:Add, Button, Default, OK
Gui, 2:Show
return
;-----------------------------------------------------
Helpwords:  ;This is a simple textbox I manually add my words from my commandlist into for fast reference.
^#!f1::
Msgbox,Commandlist = @1,@2,@3,@4,@5,@6,
Return
;-----------------------------------------------------
2ButtonOK:  ; This section is used by the "about box" above.
2GuiClose:
2GuiEscape:
Gui, 1:-Disabled  ; Re-enable the main window (must be done prior to the next step).
Gui Destroy  ; Destroy the about box.
return
;-----------------------------------------------------
GuiDropFiles:  ; Support drag & drop.
Loop, parse, A_GuiEvent, `n
{
    SelectedFileName = %A_LoopField%  ; Get the first file only (in case there's more than one).
    break
}
Gosub FileRead
return
;----------------------------------------------------- 
GuiSize:
if ErrorLevel = 1  ; The window has been minimized.  No action needed.
    return
; Otherwise, the window has been resized or maximized. Resize the Edit control to match.
NewWidth := A_GuiWidth - 20
NewHeight := A_GuiHeight - 34
Button1posw := A_GuiWidth - 295
Button2posw := A_GuiWidth - 245
Button3posw := A_GuiWidth - 195
Static1posw := A_GuiWidth - 133
Static2posw := A_GuiWidth - 85
Static3posw := A_GuiWidth - 385

GuiControl, Move, MainEdit, W%NewWidth% H%NewHeight%
GuiControl, Move, MainEdit2, W%NewWidth% H%NewHeight%
GuiControl, Move, SysTabControl321, W%NewWidth% H%NewHeight%
;GuiControl, Move, Tab 2, W%NewWidth% H%NewHeight%


GuiControl, Move, Button1, x%Button1posw% y4
GuiControl, Move, Button2, x%Button2posw% y4
GuiControl, Move, Button3, x%Button3posw% y4
GuiControl, Move, Static1, x%Static1posw% y8
GuiControl, Move, Static2, x%Static2posw% y8
GuiControl, Move, Static3, x%Static3posw% y8

return
;-----------------------------------------------------   
FileExit:     ; User chose "Exit" from the File menu.
GuiClose:      ; User closed the window.
ExitApp
;-----------------------------------------------------
^+#d::  ;;Activate DragonPad²
WinActivate,DragonPad²
Return
;-----------------------------------------------------
pause::pause
;-----------------------------------------------------
STOPTimedCutNpaste:

If stop = 1
stop = 0
Else
stop = 1
ControlSetText,Edit1,%Vishnu%,DragonPad²
return
;-----------------------------------------------------
SingleCutNpaste:
^!#v::  ;;Single instance CutNPaste -- not timed that is :)
Gosub,CutNPaste
Return
;-----------------------------------------------------
^+#Backspace::  ;;Exit
ExitApp
Return
;-----------------------------------------------------
^+#5::
Winactivate,WordPerfect
Winactivate,DragonPad²
Return
;-----------------------------------------------------
CutNPaste:
^#!b::  ;;CutnPaste Single Instance
ControlSend,Edit1,^{end},deleme.txt - Notepad
SetKeyDelay, 1, 0
Clipboard =
Winactivate,DragonPad²
ControlSend,Edit1,^a,DragonPad²
ControlSend,Edit1,^x,DragonPad²
;MsgBox,Clipboard = %Clipboard%
FileAppend `n*%timez%*%ntime%* -- %A_Space%%Clipboard%,Testy.txt
StringReplace,Clipboard,Clipboard,`n`n,`n,all
StringReplace,Clipboard,Clipboard,%A_Space%%A_Space%,%A_Space%,all
Loop,Parse,Clipboard,%A_Space%
{
Kali = %A_Loopfield%
;MsgBox,Kali = %Kali%
If Kali in %Commandlist%
{
;MsgBox, %Kali%, is in Commandlist
Grier++
FileAppend, `n|%Grier%|%timez%%ntime% -- %A_Space%%Kali%,%FullCurFiln%
SetKeyDelay,1,1
Gosub, %Kali%
}
Else
ControlSend,Edit1,%Kali%%A_Space%,deleme.txt - Notepad
;This is the word processor you intend to send text to.  In this case it's WordPerfect.
Durga = %A_Index%
}
Wordcount+=%Durga%
GuiControlGet, Static3
If ( Static3 <> Wordcount )            ; Update the control only when needed
GuiControl,, Static3, %Wordcount% words  ; this avoids flicker
;SetKeyDelay -1,-1
Return
;-----------------------------------------------------
;-----------------------------------------------------
; This is where the commands go. There have to be entries in the commandlist for these to work.

@1:
;MsgBox, Command = @1
ControlSend,Edit1,^{end} `n{Tab}|%Grier%| {Tab} This is some example text.  Please note that the number between the pipes will match the corresponding entry in the backup textfile.  That number is associated with the variable grier and is incremented with every successful cutnpaste.   This can be very useful. To see what it does try doing all of these demo commands and then opening up the backup textfile which would be %FullCurFiln%.deleme.txt.,deleme.txt - Notepad

Return

@2:
;MsgBox, Command = @2
ControlSend,Edit1,^{end} `n{Tab}|%Grier%| {Tab} *%nTime%*%timez%* {Tab} This is a time-stamped example text.  If you didn't start the timer`, you will only see a single time and if you start the timer you will see two. HINT -- You start the timer by pressing the Start button. :){Space}{Space},deleme.txt - Notepad
Return

@3:
;MsgBox, Command = @3
SetKeyDelay, -1, -1
ControlSend,Edit1,^{end} `n{Tab}|%Grier%|{Tab}{f5} -- This is example text being sent to Notepad using the setkeydelay command to speed up input.  In my experience so far this can result in errors such as the wrong letters being capitalized etc.  If you see no errors in this text`, you may be want to experiment with using the -1`,-1 setting.  Otherwise you may have to keep it as I set it`, at 1`,1., deleme.txt - Notepad
SetKeyDelay, 1,1
Return

@4:
;MsgBox, Command = @4
WinActivate, deleme.txt - Notepad
SendInput,^{end} `n{Tab}|%Grier%|{Tab}And this method sends text much faster but it also does not send it in the background.
WinActivate,DragonPad²
Return

@5:
;MsgBox, Command = @5
Blockinput, On
WinActivate, deleme.txt - Notepad
SendInput,^{end} `n{Tab}|%Grier%|{tab}And this is the same method protecting the function with Blockinput.  I have not experimented with using Dragon at the same time as this.  You cannot use the mouse/keyboard while blockinput is on`, and I doubt you can use Dragon either`, but as I said I have not tried yet.
BlockInput, Off
WinActivate,DragonPad²
Return

@6:
;MsgBox, Command = @6
ControlSend,Edit1,^{end} `n{Tab}|%Grier%|{tab}*%nTime%*%timez%* And this should open up your backup textfile. You will see that it resembles a logfile`, and logs commands sent as their command names rather than the resulting text., deleme.txt - Notepad
Run, Notepad.exe %FullCurFiln%
Return

;=== The killswitch shortcut (Ctrl-Alt-Backspace)
^!Backspace::Reload
;---------------------------------------------------

StartStop:

 GuiControlGet, StartStop
 If ( StartStop = "Start" )
  {
     GuiControl,, StartStop, Stop
     SetTimer, Count,990
  }
 Else
  {
     GuiControl,, StartStop, Start
     SetTimer, Count, Off
     GuiControl,, PauseResume, Pause
     DateTimeStamp = 20061103000000

  }
Return
 
PauseResume:

 GuiControlGet, StartStop
 If ( StartStop = "Start" )
     Return
 GuiControlGet, PauseResume
 If ( PauseResume = "Pause" )
  {
     GuiControl,, PauseResume, Resume
     SetTimer, Count, OFF
  }
 Else
  {
     GuiControl,, PauseResume, Pause
     SetTimer, Count, 990
  }
Return

Reset:

  GuiControl,, Static1, 00:00:00
  DateTimeStamp = 20061103000000
Return


Count:

DateTimeStamp += 1, Seconds
FormatTime, nTime, %DateTimeStamp%, HH:mm:ss
GuiControlGet, Static1
If ( Static1 <> nTime )            ; Update the control only when needed
GuiControl,, Static1, %nTime%  ; this avoids flicker
Return

update_clock:

FormatTime, timez,, HH:mm:ss
ControlSetText, Static2,%timez%,DragonPad²
Return

; The updateclock function is courtesy of SKAN -- ONCE AGAIN!
;-----------------------------------------------------

rctrl & numpad1::
MsgBox,Make Sure Dragon is in Dictation Mode.`nStart the timer.
Send, ^{f12}
WinActivate, deleme.txt - Notepad
WinActivate, DragonPad²
Return

rctrl & numpad2::
WinActivate, deleme.txt - Notepad
WinActivate, DragonPad²
Return

;-----------------------------------------------------

;OK, NEW VERSION OF TIMEDCUTNPASTE ADDED 02.11.09

TIMEDCUTNPASTE:
rctrl & numpad0::  ;;Init timed CutNPaste
ControlSend,Edit1,^{end},deleme.txt - Notepad
stop = 0
WinActivate, deleme.txt - Notepad
Winactivate, DragonPad²
SetKeyDelay, 1, 1
Loop
{ ;111 This is the main loop that contains all others
Winactivate,DragonPad²
if stop = 1
break
else
Lakshmi =
Loop
{  ;222 This loop just waits for input in the main edit
if stop = 1
break
else
ControlGetText,Lakshmi,Edit1,DragonPad²
StringLen,LakshmiLen,Lakshmi
Stringlen,SaraLen,Sarasvati
;MsgBox,%Lakshmi% -- %LakshmiLen% -- %SaraLen%
; If Lakshmi =  ;If Lskshmi is 0 then Sarasvati should be also, normally!
if %LakshmiLen% = %SaraLen%
Sleep, 250
else
break
}  ;222
Ganesa := ( LakshmiLen - SaraLen ) ;Ganesa represents the number of new characters
;MsgBox,%Ganesa%
StringRight,Hanuman,Lakshmi,%Ganesa% ;Hanuman is those characters
;MsgBox,%Hanuman%

FileAppend `n|%grier%| {tab} *%timez%*%ntime%* -- %A_Space%%Hanuman%,%FullCurFiln% ; Appends Hanuman to logfile

Balaram := RegexReplace(Hanuman,"\s+"," ")

;MsgBox,%Balaram%
Loop,Parse,Balaram,%A_Space%;  ; parses based on A-Space as separater
{ ;333 This is where we separate words from commmands
AutoTrim,On
Kali = %A_Loopfield%
;MsgBox,Kali = %Kali%
Wordcount = %A_Index%
If Kali in %Commandlist%
{ ;444 ;This is where commands are transferred to their respective gosubs
Grier++ ;This increments var Grier
FileAppend, `n|%Grier%|*%timez%*%ntime%* -- %A_Space%%Kali%,%FullCurFiln%
Sleep,50 ;may not be necessary, I don't remember
Gosub, %Kali%
} ;444
Else
ControlSend,Edit1,%Kali%%A_Space%,deleme.txt - Notepad
;This is the word processor you intend to send text to.  In this case it's Notepad.
Durga = %A_Index%
} ;333
GuiControlGet, Static3
If ( Static3 <> Wordcount )            ; Update the control only when needed
GuiControl,, Static3, %Wordcount% words  ; this avoids flicker
Sleep, 2000
Sarasvati := Lakshmi


Parvati := Sarasvati . " " . Lakshmi

If stop = 1
Break
} ;111
ControlSend,Edit1,^{end},DragonPad²
Return

F4::
stop = 1
return


I think this is a really exciting project and it's a good thing I do because nobody else seems to :-) You are welcome to distribute it, modify it, delete all the comments, whatever, but you are forbidden to sell this for money or to claim authorship of it. The AutoHotKey scripting language is licensed under the GNU convention, and as the guy who's been putting this together using said scripting language, I pronounce the results of my work to be under the same auspices.

Oh, and this script is in no way affiliated with Dragon Naturally Speaking or Nuance Software. It is entirely an experimental user-created adjunct to speech recognition software, (and should work equally well with ViaVoice). Use entirely at your own risk. So there.


Last edited by ribbet.1 on February 26th, 2009, 10:13 am, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 13th, 2009, 8:46 pm 
Offline

Joined: February 7th, 2009, 11:28 pm
Posts: 384
ribbet.1 wrote:
The overall purpose of this program is to extend the potential of Dragon Naturally Speaking, to dictate with DNS at a higher speed. and to provide an alternative way of sending commands, including "text commands" without the 1/2-second pause you always get with Dragon while it executes a command. (Or at least you do with the Preferred version. I can't speak to the "Pro" version.)


I get two types of delays:

1. A slight pause while Dragon waits to see if I'm finished talking (at least in normal mode when it has to decide whether I'm dictating or commanding). I think it may be possible to reduce this wait time by reducing the "pause required before commands" under 'options->commands', and/or by changing 'speed vs. accuracy' under 'options->miscellaneous'.

2. Normal delays caused by limited resources, etc. For example, whether I click Firefox shortcut, or tell DNS to "Open Mozilla Firefox," sometimes the Firefox launches faster than other times for mystery reasons. Dragon is the most resource hungry program I generally use, so I assume it's very presence alone may contribute to these type of delays.

This sounds like an interesting project though, and I plan to give it a try myself at some point. For now I'm using DNS 10 Pro with Natlink/Vocola/AHK/etc. (I started with DNS Preferred, hence the Natlink/Vocola... - and I added AHK b/c it's easier for me for macros than either DNS Pro or Natlink/Vocola)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 14th, 2009, 11:30 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Nice to hear a response! I've currently got a couple major objectives with this DragonPad² that I'm thinking about. Maybe more.

First, by using ControlSend at the SetKeyDelay rate that I have to use, DragonPad² seems pretty slow. It generally keeps up with me but there is a lag of a couple of seconds. The most likely workaround I can do for this right now is to give up using a word processor entirely, and instead to append the DragonPad² strings to a textfile and to have a text editor refresh view with every loop, displaying the changes rather than being written to. This should yield a faster response, by virtue of not using ControlSend -- or a word processor.

Next objective is to get the word count going right, and to have a somewhat accurate WPM display.

Third major objective is I forget. Well, there are lots of things I'm trying to do to make Dragon play nice; some not connected to this little DragonPad² project at all. If I have any luck I'll post my results here.

Cheers, ribbet.1


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 15th, 2009, 1:33 pm 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
pajenn wrote:
I get two types of delays:

1. A slight pause while Dragon waits to see if I'm finished talking (at least in normal mode when it has to decide whether I'm dictating or commanding). I think it may be possible to reduce this wait time by reducing the "pause required before commands" under 'options->commands', and/or by changing 'speed vs. accuracy' under 'options->miscellaneous'.


Number one is the type I'm talking about, which I think also applies to punctuation as well as commands, at any "pause required" setting. I'm working toward a high accuracy level and speed, a consistent 150+ wpm and 97% accuracy or better, which preclude having a momentary pause to execute a command. That is the gist of why I am doing this. For ordinary DNS usage, my issues are irrelevant to most users, I imagine.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2009, 10:17 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Oh hey, I just noticed that line 65 in the original script I posted had a WinActivate where it should have had a Run, which I changed just for testing purposes and forgot to change back. I have just corrected it. I'll be posting some improvements or modifications within the next day or 2.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 27th, 2009, 7:57 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Here is today's revision. This version has abandoned using ControlSend because it's too slow on my computer. Instead, I've decided to append all text from DragonPad² to a textfile, which is open in a text editor -- in this case TextPad -- and refreshing the view periodically. To try this version you will of course need to globally replace the ahk_class TextPad4 or whatever with your favorite text editor or just notepad.

If you don't know how, just start an AHK macro, right-click on it and select "Window Spy." Use it to learn how AHK identifies your text editor, and use that name or ahk class instead of the textpad identifier. But this is not a tutorial on that.

This script may contain errors, and I want to hear if it does, but this is just like a rough draft. The proper version I'm working on has a LOT more commands, which I didn't include for personal reasons, and just included a few demo commands again.

So to roughly describe the usage again, you start Dragon, start DragonPad² and start your text editor. DragonPad² should have created a text file that will contain all the dictated text ultimately, and you may need to open that manually.

Train Dragon to type the made-up words in the command list. then dictate them into DragonPad². Then press Ctrl-Numpad4 for a single cutnpaste. It will execute the commands associated with the words. Then start making up your own commands.

Beyond that, use your imagination. This program is not finished, and you can take this a number of directions. Where I'm headed with it next is incorporation of a footpedal to use Dragon's Press-to-talk hotkey, and the incorporation of a 3rd party audio recording program which will record me while I dictate, and place bookmarks in the audio recording when I press the footpedal. This may not be to your interest, but hey, the price is right. And once again, my reasons are kind of specialized and probably don't make sense to many other users.

Code:
#Persistent
settimer, update_clock, 50
SetKeyDelay, 1, 1
;return
Grier = 1
Commandlist = nookey,pookey,cukey,dookie

;; gotta finish up this part here pal

Wordcount = 0

; DragonPad2 -- FREEWARE by ribbet.1 and many others
; who have taught me mro provided code I've lifted from, including MikeG and
; most especially Chris and SKAN!

; You are free to distribute this script, modify or compile it, and MAY NOT CHARGE MONEY FOR IT!

; To add a new command you must type one in here.
; Some characters are illegal and must be escaped or left unused, such as comma or colon.

; This program is initially based on the 'simple text editor with menu bar,' provided at the ahk website, nothing more.

; Create the sub-menus for the menu bar:
DateTimeStamp=20061103000000
Menu, FileMenu, Add, &New, FileNew
Menu, FileMenu, Add, &Open, FileOpen
Menu, FileMenu, Add, &Save, FileSave
Menu, FileMenu, Add, Save &As, FileSaveAs
Menu, FileMenu, Add  ; Separator line.
Menu, FileMenu, Add, E&xit, FileExit
Menu, HelpMenu, Add, &About, HelpAbout
Menu, HelpMenu, Add, &Woids, HelpWoids
;Menu, StopwatchMenu, Add, &StartStop, StartStop
;Menu, StopwatchMenu, Add, &PauseResume, PauseResume
Menu, MyMenuBar, Add, &File, :FileMenu
Menu, MyMenuBar, Add, &Help, :HelpMenu
Menu, MyMenuBar, Add, &TimedCutNpaste, TimedCutNpaste
Menu, MyMenuBar, Add, &STOPTimedCutNpaste, StopTimedCutNpaste
Menu, MyMenuBar, Add, &SingleCutNpaste, SingleCutNpaste
;Menu, MyMenuBar, Add, &Actions, :Actions
;Menu, StopwatchMenu, Add, &Stopwatch, StartStopwatch
;Menu, MyMenuBar, Add, &Stopwatch, StartStopwatcher
;Menu, StopwatchMenu, Add, &Reset, Reset


; Attach the menu bar to the window:
Gui, Menu, MyMenuBar

; Create the main Edit control and display the window:
Gui, +Resize -MaximizeBox  ; Make the window resizable.
;Gui, Add, Tab2,w600 h80,Main||Non-Main
Gui, Add,Edit,vMainEdit WantTab x10 y28 w600 h80
Gui, Add, Button, x326 y4 w50 h20 vStartStop gStartStop, Start
Gui, Add, Button, x376 y4 w50 h20 vPauseResume gPauseResume, Pause
Gui, Add, Button, x426 y4 w50 h20 vReset gReset, Reset
Gui, Add, Text, x508 y8 w50 h20 +Center, 00:00:00
Gui, Add, Text, x556 y8 w50 h20 +Center, 00:00:00
Gui, Add, Text, x256 y8 w90 h20, 0 Words

Gui, Font, S12 CDefault, Verdana
CurrentFiln =  ; Indicate that there is no current file.
Gui,Tab,2
;Gui, Add,Edit,vMainEdit2 WantTab x10 y28 w600 h80
Gui, Show,, DragonPad²
;return

FileSelectFile,Mansarowar
If Mansarowar =
{
Mansarowar = DragonDictation-%A_MM%-%A_DD%.depo
Fileappend, Created %A_MM%-%A_DD%-%A_Hour%-%A_Min%`n,%Mansarowar%
MsgBox,The Dictation is being saved to `n%A_Workingdir%\%Mansarowar%`n
}
Else
MsgBox,%Mansarowar%


FileSelectFile,CurrentFiln
If CurrentFiln =
{
CurrentFiln = %A_MM%-%A_DD%-%A_Hour%-%A_Min%.txt
Fileappend, Created %A_MM%-%A_DD%-%A_Hour%-%A_Min%`n,%CurrentFiln%
MsgBox,The literal textstrings are being saved to `n%A_Workingdir%\%CurrentFiln%`n
FullCurFiln = %A_Workingdir%\%CurrentFiln%
MsgBox,%FullCurFiln%
Return
}
Else
MsgBox,%CurrentFiln%

Run, %Mansarowar%

Return 

;-----------------------------------------------------
FileNew:
GuiControl,, MainEdit  ; Clear the Edit control.
return
;-----------------------------------------------------
FileOpen:
Gui +OwnDialogs  ; Force the user to dismiss the FileSelectFile dialog before returning to the main window.
FileSelectFile, SelectedFileName, 3,, Open File, Text Documents (*.txt)
if SelectedFileName =  ; No file selected.
    return
Gosub FileRead
return
;-----------------------------------------------------
FileRead:  ; Caller has set the variable SelectedFileName for us.
FileRead, MainEdit, %SelectedFileName%  ; Read the file's contents into the variable.
if ErrorLevel
{
    MsgBox Could not open "%SelectedFileName%".
    return
}
GuiControl,, MainEdit, %MainEdit%  ; Put the text into the control.
FullCurFiln = %SelectedFileName%
Gui, Show,, DragonPad²   ; Show file name in title bar.
MsgBox,%FullCurFiln%
return

FileSave:
if FullCurFiln =   ; No filename selected yet, so do Save-As instead.
    Goto FileSaveAs
Gosub SaveCurrentFile
return
;-----------------------------------------------------
FileSaveAs:
Gui +OwnDialogs  ; Force the user to dismiss the FileSelectFile dialog before returning to the main window.
FileSelectFile, SelectedFileName, S16,, Save File, Text Documents (*.txt)
if SelectedFileName =  ; No file selected.
    return
FullCurFiln = %SelectedFileName%
Gosub SaveCurrentFile
return
;-----------------------------------------------------
SaveCurrentFile:  ; Caller has ensured that CurrentFiln is not blank.
IfExist %FullCurFiln%
{
    FileDelete %FullCurFiln%
    if ErrorLevel
    {
        MsgBox The attempt to overwrite "%FullCurFiln%" failed.
        return
    }
}


GuiControlGet, MainEdit  ; Retrieve the contents of the Edit control.
FileAppend, %MainEdit%, %FullCurFiln%  ; Save the contents to the file.
Gui, Show,, DragonPad²
MsgBox,%FullCurFiln%
return
;-----------------------------------------------------
Pause::Pause
;-----------------------------------------------------
HelpAbout:
Gui, 2:+owner1  ; Make the main window (Gui #1) the owner of the "about box" (Gui #2).
Gui +Disabled  ; Disable main window.
Gui, 2:Add, Text,, Text for about box.
Gui, 2:Add, Button, Default, OK
Gui, 2:Show
return
;-----------------------------------------------------
HelpWoids:  ;;this is merely a textbox to display what words I have created in the commandlist, nothing more.
^+#4::
Msgbox,Commandlist = nookey `npookey `ncukey `ndookie
Return
;-----------------------------------------------------
2ButtonOK:  ; This section is used by the "about box" above.
2GuiClose:
2GuiEscape:
Gui, 1:-Disabled  ; Re-enable the main window (must be done prior to the next step).
Gui Destroy  ; Destroy the about box.
return
;-----------------------------------------------------
GuiDropFiles:  ; Support drag & drop.
Loop, parse, A_GuiEvent, `n
{
    SelectedFileName = %A_LoopField%  ; Get the first file only (in case there's more than one).
    break
}
Gosub FileRead
return
;-----------------------------------------------------
GuiSize:
if ErrorLevel = 1  ; The window has been minimized.  No action needed.
    return
; Otherwise, the window has been resized or maximized. Resize the Edit control to match.
NewWidth := A_GuiWidth - 20
NewHeight := A_GuiHeight - 34
Button1posw := A_GuiWidth - 295
Button2posw := A_GuiWidth - 245
Button3posw := A_GuiWidth - 195
Static1posw := A_GuiWidth - 133
Static2posw := A_GuiWidth - 85
Static3posw := A_GuiWidth - 385

GuiControl, Move, MainEdit, W%NewWidth% H%NewHeight%
GuiControl, Move, MainEdit2, W%NewWidth% H%NewHeight%
GuiControl, Move, SysTabControl321, W%NewWidth% H%NewHeight%
;GuiControl, Move, Tab 2, W%NewWidth% H%NewHeight%


GuiControl, Move, Button1, x%Button1posw% y4
GuiControl, Move, Button2, x%Button2posw% y4
GuiControl, Move, Button3, x%Button3posw% y4
GuiControl, Move, Static1, x%Static1posw% y8
GuiControl, Move, Static2, x%Static2posw% y8
GuiControl, Move, Static3, x%Static3posw% y8

return
;-----------------------------------------------------
FileExit:     ; User chose "Exit" from the File menu.
GuiClose:      ; User closed the window.
ExitApp
;-----------------------------------------------------
^+#d::  ;;Activate DragonPad²
WinActivate,DragonPad²
Return
;-----------------------------------------------------
STOPTimedCutNpaste:
^numpad6::  ;Stop timed cutnpaste
stop = 1
Sleep,200
Pause
Return

;*  ControlSend,Edit1,{F4},DragonPad²
;* Return
;-----------------------------------------------------
SingleCutNpaste:
^numpad4::  ;;CutnPaste Single Instance
stop = 0
WordCount =
Sarasvati =
GuiControl,, Static3, %Wordcount% words
Winactivate, DragonPad²
SetKeyDelay, 1, 1
Loop,1
{ ;111 This is the main loop that contains all others
Winactivate,DragonPad²
if stop = 1
break
else

Gosub,CutNPaste

Sarasvati := Lakshmi

Wordcount =

;Parvati := Sarasvati . " " . Lakshmi

If stop = 1
Break
ControlSetText,Edit1,,DragonPad²
} ;111
GuiControl,, Static3, %Wordcount% words
Return
;-----------------------------------------------------
TIMEDCUTNPASTE:
^numpad0::  ;;Init timed CutNPaste
stop = 0
Winactivate, DragonPad²
SetKeyDelay, 1, 1
Loop
{ ;111 This is the main loop that contains all others
Winactivate,DragonPad²
if stop = 1
break
else
Lakshmi =


Gosub,CutNPaste

GuiControlGet, Static3
If ( Static3 <> Wordcount )            ; Update the control only when needed
GuiControl,, Static3, %Wordcount% words  ; this avoids flicker
Sleep, 2000
Sarasvati := Lakshmi

If stop = 1
Break
} ;111
ControlSend,Edit1,^{end},DragonPad²

^+#Backspace::  ;;Exit
ExitApp
Return
;-----------------------------------------------------
^+#5::
SetKeyDelay,1,1
Winactivate,ahk_class TextPad4
WinWaitActive,ahk_class TextPad4
;Sleep,30
ControlSend,,^{end},ahk_class TextPad4
Winactivate,DragonPad²
Return
;-----------------------------------------------------
CutNPaste:

Loop
{  ;222 This loop just waits for input in the main edit
if stop = 1
break
else
ControlGetText,Lakshmi,Edit1,DragonPad²
StringLen,LakshmiLen,Lakshmi
Stringlen,SaraLen,Sarasvati
;MsgBox,%Lakshmi% -- %LakshmiLen% -- %SaraLen%
if %LakshmiLen% = %SaraLen%
Sleep, 250
else
break
}  ;222
Ganesa := ( LakshmiLen - SaraLen ) ;Ganesa represents the number of new characters
;MsgBox,%Ganesa%
StringRight,Hanuman,Lakshmi,%Ganesa% ;Hanuman is those characters
;MsgBox,%Hanuman%

FileAppend `n|%grier%| {tab} *%timez%*%ntime%* -- %A_Space%%Hanuman%,%FullCurFiln% ; Appends Hanuman to logfile

Balaram := RegexReplace(Hanuman,"\s+"," ")

;MsgBox,%Balaram%
Loop,Parse,Balaram,%A_Space%, %A_Space%  ; parses based on A-Space as separator
{ ;333 This is where we separate words from commmands
AutoTrim,On
Kali = %A_Loopfield%
;MsgBox,Kali = %Kali%
If Kali in %Commandlist%
{ ;444 ;This is where commands are transferred to their respective gosubs
Grier++ ;This increments var Grier
FileAppend, `n|%Grier%|*%timez%*%ntime%* -- %A_Space%%Kali%,%FullCurFiln%
Sleep,50 ;may not be necessary, I don't remember
Gosub, %Kali%
} ;444
Else
FileAppend,%Kali%%A_Space%,%Mansarowar% ;This appends to the dictation textfile
Durga = %A_Index%
If A_Loopfield !=
++Wordcount
; }
} ;333
;WinActivate,ahk_class TextPad4
ControlSend,,^{End},ahk_class TextPad4
WinActivate,DragonPad²

Return

^F7::
Send,^{F12}
WinActivate,ahk_class TextPad4
ControlSend,,^{End},ahk_class TextPad4
WinActivate,DragonPad²
Return

;-----------------------------------------------------
;-----------------------------------------------------

; Here are the gosubs that send the actual commands

nookey:  ;;q-tab
   FileAppend,|%Grier%|`n%A_Tab% Q:.%A_Space% %A_Space%,%Mansarowar%
   Return

pookey: 
   FileAppend,`n%A_Space%Your current active directory is %A_WorkingDir%`n,%Mansarowar%
   Return

cukey: 
   FileAppend,`n*%nTime%*%timez%*`n`nAnd Jerry Mathers as "The Beaver." -- And BTW`, if only one time is displayed above`, try starting the timer on the DragonPad² GUI and dictating `"cukey`" again. ,%Mansarowar%
   Return

dookie:  ;;dash-q-tab
InputBox, Zibno, CLAIMANT Exhibit MARKED, Please enter Exhibit Number., , 340, 160
if ErrorLevel
    {
    MsgBox, CANCEL was pressed.
    Return
    }
else
   {
    FileAppend,.`n%A_Space%(Whereupon`, the document was marked for identification%A_Space%,%Mansarowar%
    FileAppend,Claimant Exhibit No.%A_Space%,%Mansarowar%
    FileAppend,%Zibno%.)`n,%Mansarowar%
    }
   Return

;---------------------------------------------------
;-----------------------------------------------------

;=== The killswitch shortcut (Ctrl-Alt-Backspace)
^!Backspace::Reload

;-----------------------------------------------------

StartStop:

 GuiControlGet, StartStop
 If ( StartStop = "Start" )
  {
     GuiControl,, StartStop, Stop
     SetTimer, Count,990
  }
 Else
  {
     GuiControl,, StartStop, Start
     SetTimer, Count, Off
     GuiControl,, PauseResume, Pause
     DateTimeStamp = 20061103000000

  }
Return

PauseResume:

 GuiControlGet, StartStop
 If ( StartStop = "Start" )
     Return
 GuiControlGet, PauseResume
 If ( PauseResume = "Pause" )
  {
     GuiControl,, PauseResume, Resume
     SetTimer, Count, OFF
  }
 Else
  {
     GuiControl,, PauseResume, Pause
     SetTimer, Count, 990
  }
Return

Reset:

  GuiControl,, Static1, 00:00:00
  DateTimeStamp = 20061103000000
Return


Count:

DateTimeStamp += 1, Seconds
FormatTime, nTime, %DateTimeStamp%, HH:mm:ss
GuiControlGet, Static1
If ( Static1 <> nTime )            ; Update the control only when needed
GuiControl,, Static1, %nTime%  ; this avoids flicker
Return

update_clock:

FormatTime, timez,, HH:mm:ss
ControlSetText, Static2,%timez%,DragonPad²
Return

; The updateclock function is courtesy of SKAN -- ONCE AGAIN!

#k::  ;;List of Hotkeys
;*******************************************************************************
;(c) by MikeG
; Extract a list of Hotstrings and Hotkeys from this script and display them
;*******************************************************************************
KeyList:
KeyList=
  AutoTrim,off
  Loop,Read,%A_ScriptFullPath%
  {
    Line=%A_LoopReadLine%
    StringLeft,C2,Line,2
; Insert blank lines
    IfEqual,C2,`;`;
    KeyList=%KeyList%`n
; Insert Hotstrings
    IfEqual,C2,`:`:
    {
      StringTrimLeft,Line,Line,2
      StringSplit,Keys,Line,`:
      Keys=%Keys1%               !
      StringLeft,Keys,Keys,20
      StringSplit,Desc,Line,`;
      StringTrimLeft,Desc,Desc%Desc0%,0
      KeyList=%KeyList%%Keys%`t`t%Desc%`n
    }
; Insert Hotkeys with ;;comments
    IfInString,Line,`;`;,IfInString,Line,`:`:
    {
      StringSplit,Keys,Line,`:
      StringReplace,Keys,Keys1,#,Win-
      StringReplace,Keys,Keys,!,Alt-
      StringReplace,Keys,Keys,^,Ctrl-
      StringReplace,Keys,Keys,+,Shift-
      StringReplace,Keys,Keys,`;,
      Keys=%Keys%               !
      StringLeft,Keys,Keys,20
      StringSplit,Desc,Line,`;
      StringTrimLeft,Desc,Desc%Desc0%,0
      KeyList=%KeyList%%Keys%`t`t%Desc%`n
    }
  }
  MsgBox,0,Hotkeys and Hotstrings list,%KeyList%
Return
;---------------------------------------------------
^+#o::ListHotKeys

;-----------------------------------------------------
^#!f1::  ;;displays purported commandlist

Msgbox,Commandlist = nookey `npookey `ncukey:  q-q-tab`ndookie
Return


;-----------------------------------------------------

^numpad1::
MsgBox,Make Sure Dragon is in Dictation Mode.`nTurn on the recording.`nStart the timer.
Send, ^{f12}
WinActivate, ahk_class TextPad4
WinActivate, DragonPad²
Return

^numpad2::
WinActivate, ahk_class TextPad4
WinActivate, DragonPad²
Return

^numpad3::
IfWinNotExist, Total Recorder
{
Run, "C:\Program Files\HighCriteria\TotalRecorder\TotalRecorder.exe"
WinWaitActive, Total Recorder
}
WinActivate, Total Recorder

IfwinNotExist, DragonBar
{
Run, "C:\Program Files\Nuance\NaturallySpeaking10\Program\natspeak.exe"
WinWait, DragonBar
WinActivate, DragonBar
}
IfWinNotExist, ahk_class TextPad4
{
Run, "C:\Program Files\ahk_class TextPad4 4\ahk_class TextPad4.exe"
WinWaitActive, ahk_class TextPad4
}
WinActivate, ahk_class TextPad4
WinActivate, DragonPad²

MsgBox,Is Dragon is in Dictation Mode?`nTurn on the recording.`nStart the timer.
Return

Scrolllock::
WinActivate, ahk_class TextPad4
WinActivate, DragonPad²
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 21st, 2009, 7:08 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Image

Image
Full Size Image: http://www.homeofthegnome.net/AHK/DragonPad2-bigpic.jpg

Update -- I've experimented with a lot of changes, and decided the edit field in DragonPad² was not necessary, and it might even help stability to allow dragon to dictate into DragonPad -- I mean the original DragonPad that came with it -- and use my little script as just a toolbar. It performs the same, but now it watches DragonPad and reads text from it into a textfile, viewing it in another program, performing whatever commands are in the text itself. And it still includes timestamping as a key function, so when a command word is uttered into Dragonpad it is optionally followed by a timestamp when executed.

The Spell, Num, and Dict buttons are meant to make it easier to switch between dictate, numbers and spell mode. Since this is a dictation aid, I saw no need to add a button to go to "normal" mode, but it would be easy enough. The F12 button just turns on the mic in Dragon. The Stop, Pause, and Reset are for the timer.

I have set it up to view the resulting textfile in Notepad++, because it's free, and has some features I really like for this purpose. For this script, I have created a simple macro to go to the bottom in NPP (^+!0), and ^+2 is mapped to "reload from disk" in NPP. So you may want to change the script, or just use NPP. It is also now set up to resize DragonPad and NPP to 1/3 and 2/3 of the active screen, as in above screen capture.

Included are a couple minor example commands. I know I haven't made this really easy to get into, now that it has Notepad++ in the script, etc., but you should be able to change npp to any other text program that you like. It requires that you have a copy of Dragon installed. And my main drive is D:\ not C:\ and you may need to do a search and replace for that, I don't remember. It shou7ld be easy enough to replace all NPP with Notepad instead. Or whatever.

To reiterate, NPP is only used to view the resulting textfile. All text from DragonPad is appended using fileappend. And after every fileappend, NPP is refreshed. And FWIW, I'm really liking NPP, so you wouldn't be suffering too much if you did install this excellent free program.


Last edited by ribbet.1 on May 21st, 2009, 5:52 pm, edited 3 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 21st, 2009, 7:19 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Oh yeah, the code.

Code:
#Persistent
settimer, update_clock, 50
SetKeyDelay, 1, 1
Grier = 0

;-----------------------------------------------------
;This is your command list.  You need to add new commands here for their scripts to execute.

Commandlist = atty1,atty2,atty3,nookey,Baby-Q,yesirree-bob

;This is your additional commandlist.  A slightly different set of instructions are executed for these, mainly that these don't cause a timestamp to be created.

Gooflist =  bootsie,bootsy,token,paren-un,mama

Wordcount = 0

; DragonPad2 -- FREEWARE by ribbet.1 and many others who have taught me or provided code I've lifted from, especially but not exclusively Chris, Rajat, and SKAN!

; You are free to distribute this script, modify or compile it, and MAY NOT CHARGE MONEY FOR IT!

; I use this program with a footpedal. I've mapped the 3 switches to Ctrl-Alt-Shift-F10, Ctrl-F6 and Ctrl-F7.  The commands they initiate can be found further below.  You can easily remap them to a more convenient hotkey if you don't have a foot pedal. 

;-----------------------------------------------------

;GUI Creation

; Create the sub-menus for the menu bar:
DateTimeStamp=20061103000000
Menu, HelpMenu, Add, &About, HelpAbout
Menu, MyMenuBar, Add, &Help, :HelpMenu
Menu, MyMenuBar, Add, &TimedCnP, TimedCutNpaste
Menu, MyMenuBar, Add, &STOPTimedCnP, StopTimedCutNpaste
Menu, MyMenuBar, Add, &SingleCnP, SingleCutNpaste
Menu, MyMenuBar, Add, Big_&Go, Big_Go
Menu, MyMenuBar, Add, Panic, Panic


; Attach the menu bar to the window:
Gui, Menu, MyMenuBar

; Create the main Edit control and display the window:
Gui, -MaximizeBox  ; Make the window resizable.
Gui, Add, Button, x15  y4 w50 h18 vStartStop gStartStop, Start
Gui, Add, Button, x65  y4 w50 h18 vPauseResume gPauseResume, Pause
Gui, Add, Button, x115 y4 w50 h18 vReset gReset, Reset
Gui, Add, Button, x165 y4 w50 h18 vSpell vSpell, Spell
Gui, Add, Button, x215 y4 w50 h18 vNum vNum, Num
Gui, Add, Button, x265 y4 w50 h18 vDict vDict, Dict
Gui, Add, Button, x315 y4 w50 h18 vF12 vF12, F12
Gui, Add, Text, x556 y4 w90 h18, 0 Words


;Gui, Font, S12 CDefault, Verdana
CurrentFiln =  ; Indicate that there is no current file.
Gui,Show,, DragonPad² -- START THE TIMER DUMMY

;-----------------------------------------------------
;Create textfile -- Default is DragonDictation-%A_MM%-%A_DD%.depo
; I have commented out the dialog that lets you select where your folder is to go.  That's just my preference.  Right now it creates a folder on the desktop and places the necessary files in it, no muss no fuss.  Uncomment the necessary lines to restore democracy.

;FileSelectFolder,Dusky,,2,Name the folder for your project -- Escape for default to %A_Desktop%\%A_MM%-%A_DD%\%A_MM%-%A_DD%
;If Dusky =
   {
   FileCreateDir,%A_Desktop%\%A_MM%-%A_DD%
   Dusky = %A_Desktop%\%A_MM%-%A_DD%
   }
SetWorkingDir,%Dusky%
;MsgBox,%A_WorkingDir%
Mansarowar = DragonDictation-%A_MM%-%A_DD%.depo
Fileappend, `nCreated %A_MM%-%A_DD%-%A_Hour%-%A_Min%`n,%Mansarowar%
CurrentFiln = %A_MM%-%A_DD%-%A_Hour%-%A_Min%.txt
Fileappend, `nCreated %A_MM%-%A_DD%-%A_Hour%-%A_Min%`n,%CurrentFiln%
Rosietext = Rosie-%A_MM%-%A_DD%-%A_Hour%-%A_Min%.txt
FileAppend, `nCreated %A_MM%-%A_DD%-%A_Hour%-%A_Min% `n,%Rosietext%

;MsgBox,The Dictation is being saved to %Mansarowar%`nThe backup text strings are being saved to %CurrentFiln%`nThe bookmarks are being saved to %Rosietext%

Run D:\Program Files\Notepad++\notepad++.exe %Mansarowar%

Gui,+AlwaysOnTop
Gui,Show,W520, DragonPad² -- START THE TIMER DUMMY
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,d,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²

Gosub, PigBodine
Return

Panic:
Reload
Return

;-----------------------------------------------------
;Below are the standard commands from the GUI menu
;-----------------------------------------------------
;-----------------------------------------------------
Pause::Pause
;-----------------------------------------------------
GuiClose:
ExitApp
;-----------------------------------------------------
HelpAbout:
Gui, 2:+owner1  ; Make the main window (Gui #1) the owner of the "about box" (Gui #2).
Gui +Disabled  ; Disable main window.
Gui, 2:Add, Text,, Text for about box.
Gui, 2:Add, Button, Default, OK
Gui, 2:Show
return
;-----------------------------------------------------
2ButtonOK:  ; This section is used by the "about box" above.
2GuiClose:
2GuiEscape:
Gui, 1:-Disabled  ; Re-enable the main window (must be done prior to the next step).
Gui Destroy  ; Destroy the about box.
return
;-----------------------------------------------------
;This begins the DragonPad² functions
;-----------------------------------------------------
^+#d::  ;;Activate DragonPad²
IfWinNotActive,DragonPad²
WinActivate,DragonPad²
else,
WinMinimize,DragonPad²
Return
;-----------------------------------------------------
STOPTimedCutNpaste:
^numpad6::  ;Stop timed cutnpaste
stop = 1
Sleep,200
;Pause
;Return
WinActivate,ahk_class TalkpadClass
Return
;-----------------------------------------------------
ButtonF12: ;;Turns mic on in Dragon
ControlClick,Button6,ahk_class DgnBarMainWindowCls
Return
;-----------------------------------------------------
 
SingleCutNpaste:
^numpad4::  ;;Init Single CutNPaste

ControlGetText,Lakshmi,RichEdit20A1,ahk_class TalkpadClass
StringLen,LakshmiLen,Lakshmi
Stringlen,SaraLen,Sarasvati
;MsgBox,%Lakshmi% -- %LakshmiLen% -- %SaraLen%
if %LakshmiLen% = %SaraLen%
Return
else
Ganesa := ( LakshmiLen - SaraLen ) ;Ganesa represents the number of new characters

StringRight,Hanuman,Lakshmi,%Ganesa% ;Hanuman is those characters
StringReplace,Hanuman,Hanuman,%A_Space%%A_Space%,%A_Space%,All
StringReplace,Hanuman,Hanuman,%A_Space%.,.,All
StringReplace,Hanuman,Hanuman,%A_Space%?,?,All
FileAppend `n|%grier%| `t @%timez%@%ntime%@ -- %A_Space%%Hanuman%,%CurrentFiln% ; Appends Hanuman to logfile

Balaram := RegexReplace(Hanuman,"\s+"," ")

Loop,Parse,Balaram,%A_Space%, %A_Space%  ; parses based on A-Space as separator
{ ;333 This is where we separate words from commmands
AutoTrim,On
Kali = %A_Loopfield%
If Kali in %Gooflist%
{ ;444 ;This is where commands are transferred to their respective gosubs
FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
Gosub, %Kali%
} ;444
Else
If Kali in %Commandlist%
{ ;444 ;This is where commands are transferred to their respective gosubs
Grier++ ;This increments var Grier
FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
Gosub, %Kali%
} ;444
Else
FileAppend,%Kali%%A_Space%,%Mansarowar%  ;This appends to the dictation textfile
Durga = %A_Index%
If A_Loopfield !=
++Wordcount
GuiControlGet, Static3
If ( Static3 <> Wordcount )            ; Update the control only when needed
GuiControl,, Static3, %Wordcount% words  ; this avoids flicker
;Sleep, 2000
Sarasvati := Lakshmi

} ;333
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
;Winactivate,ahk_class Notepad++
WinActivate,DragonPad²
ControlSend,RichEdit20A1,`n`n,ahk_class TalkpadClass 

Return
;-----------------------------------------------------
TIMEDCUTNPASTE:
^numpad0::  ;;Init timed CutNPaste
stop = 0
Winactivate, ahk_class TalkpadClass
SetKeyDelay, 1, 1
Loop
{ ;111 This is the main loop that contains all others
Winactivate,ahk_class TalkpadClass
if stop = 1
break
else
Lakshmi =
Gosub,CutNPaste
GuiControlGet, Static3
If ( Static3 <> Wordcount )            ; Update the control only when needed
GuiControl,, Static3, %Wordcount% words  ; this avoids flicker
Sleep, 2000
Sarasvati := Lakshmi
} ;111

Return


^+#Backspace::  ;;Exit
ExitApp
Return

;-----------------------------------------------------
CutNPaste:

Loop
{  ;222 This loop just waits for input in the main edit
if stop = 1
break
else
ControlGetText,Lakshmi,RichEdit20A1,ahk_class TalkpadClass
StringLen,LakshmiLen,Lakshmi
Stringlen,SaraLen,Sarasvati
;MsgBox,%Lakshmi% -- %LakshmiLen% -- %SaraLen%
if %LakshmiLen% = %SaraLen%
Sleep, 250
else
break
}  ;222
Ganesa := ( LakshmiLen - SaraLen ) ;Ganesa represents the number of new characters
;MsgBox,%Ganesa%
StringRight,Hanuman,Lakshmi,%Ganesa% ;Hanuman is those characters
;MsgBox,%Hanuman%

FileAppend `n|%grier%| {tab} @%timez%@%ntime%@ -- %A_Space%%Hanuman%,%CurrentFiln% ; Appends Hanuman to logfile

Balaram := RegexReplace(Hanuman,"\s+"," ")

;MsgBox,%Balaram%
Loop,Parse,Balaram,%A_Space%, %A_Space%  ; parses based on A-Space as separator
{ ;333 This is where we separate words from commmands
AutoTrim,On
Kali = %A_Loopfield%
;MsgBox,Kali = %Kali%
If Kali in %Gooflist%
{ ;This is where commands are transferred to their respective gosubs
FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
Gosub, %Kali%
}
Else
If Kali in %Commandlist%
{ ;This is where commands are transferred to their respective gosubs
Grier++ ;This increments var Grier
FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
Sleep,50 ;may not be necessary, I don't remember
Gosub, %Kali%
}
Else
FileAppend,%Kali%%A_Space%,%Mansarowar% ;This appends to the dictation textfile
Durga = %A_Index%
If A_Loopfield !=
++Wordcount
; }
} ;333
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Winactivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
;ControlSend,RichEdit20A1,`n`n,ahk_class TalkpadClass
Return

;This is the footpedal hotkey. 
;-----------------------------------------------------
;These are utility hotkeys for use by footpedal

^+!f10:: ;;Activate Npp, goto bottom, reactivate DragonPad
IfwinNotActive,ahk_class Notepad++
{
Winactivate,ahk_class Notepad++
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
}
WinActivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
;ControlSend,,`n`n,DragonPad²
Return

^F7::
;Send,^{F12}
ControlSend,,^+2,ahk_class Notepad++ ;This is mapped to "reload from disk" in NPP
ControlSend,,^+!0,ahk_class Notepad++  ;   I made the simplest of all macros for NPP -- goto bottom :-) and gave it this hotkey.
WinActivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
Return

^F6::
Gosub,SingleCutNpaste
Winactivate,ahk_class Notepad++
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
WinActivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
ControlSend,,^+!0,ahk_class Notepad++
Return

^+#f6::  ;;Just put a couple carriage returns in DragonPad²
ControlSend,,^+!0,ahk_class Notepad++

ControlSend,RichEdit20A1,`n`n,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{End},ahk_class TalkpadClass
Return

;-----------------------------------------------------
;-----------------------------------------------------
;Begins the commands proper

atty1:
;MsgBox, Command = Atty1

FileAppend,[%Grier%||%MP%|@%timez%@%ntime%@]`n%A_Tab%%A_Tab%%A_Tab%Atty.1:*.%A_Space%%A_Space%,%Mansarowar%
Return

atty2:
;MsgBox, Command = Atty2

FileAppend,[%Grier%||%MP%|@%timez%@%ntime%@]`n%A_Tab%%A_Tab%%A_Tab%Atty.2:*.%A_Space%%A_Space%,%Mansarowar%
Return

atty3:
;MsgBox, Command = Atty3

FileAppend,[%Grier%||%MP%|@%timez%@%ntime%@]`n%A_Tab%%A_Tab%%A_Tab%Atty.3:*.%A_Space%%A_Space%,%Mansarowar%
Return

nookey:  ;;q-tab

   FileAppend,[%Grier%||%MP%|@%timez%@%ntime%@]`n%A_Tab% Q*.%A_Space% %A_Space%,%Mansarowar%
   Return

Baby-Q:

   FileAppend,[%Grier%||%MP%|@%timez%@%ntime%@]`n%A_Tab% Q*.%A_Space% %A_Space%,%Mansarowar%
   Return


yesirree-bob:  ;;Q-A-tab - Yes - P-Q-Tab

      FileAppend,?%A_Space%%A_Space%[%Grier%||%MP%|@%timez%@%ntime%@]`n%A_Tab% A*.%A_Space% %A_Space% Yes. `n%A_Tab%Q*.%A_Space%,%Mansarowar%
   Return


paren-un:  ;;(unintelligible)
;
   FileAppend,`(unintelligible|@%timez%@%ntime%@|`),%Mansarowar%
   Return
   
   
Bootsie:  ;;?
;
   FileAppend,?%A_Space%%A_Space%,%Mansarowar%
   Return
   
Bootsy:  ;;?
;
   FileAppend,?%A_Space%%A_Space%,%Mansarowar%
   Return

token:  ;;@@TOKEN@@
;
   FileAppend,`@``@TOKEN|@%timez%@%ntime%@|``@`@%A_Space%%A_Space%,%Mansarowar%
   Return

   
mama:
   FileAppend,uh-huh.,%Mansarowar%
   Return
   

;=== The killswitch shortcut (Ctrl-Alt-Win-Backspace)

^!#Backspace::Reload

;-----------------------------------------------------
;-----------------------------------------------------
;This is the stopwatch

StartStop:

 GuiControlGet, StartStop
 If ( StartStop = "Start" )
  {
     GuiControl,, StartStop, Stop
     SetTimer, Count,990
  }
 Else
  {
     GuiControl,, StartStop, Start
     SetTimer, Count, Off
     GuiControl,, PauseResume, Pause
     DateTimeStamp = 20061103000000

  }
Return

PauseResume:

 GuiControlGet, StartStop
 If ( StartStop = "Start" )
     Return
 GuiControlGet, PauseResume
 If ( PauseResume = "Pause" )
  {
     GuiControl,, PauseResume, Resume
     SetTimer, Count, OFF
  }
 Else
  {
     GuiControl,, PauseResume, Pause
     SetTimer, Count, 990
  }
Return

Reset:

  ;sGuiControl,, Static1, 00:00:00
  Gui,Show,, DragonPad² -- 00:00:00 -- %Timez%
  DateTimeStamp = 20061103000000
Return


Count:

DateTimeStamp += 1, Seconds
FormatTime, nTime, %DateTimeStamp%, HH:mm:ss
;GuiControlGet, Static1
If ( nDoze <> nTime )            ; Update the control only when needed
{
Gui,Show,NoActivate, DragonPad² -- %nTime% -- %Timez%
;GuiControl,, Static1, %nTime%  ; this avoids flicker
}
nDoze := nTime
Return

update_clock:

FormatTime, timez,, HH:mm:ss
;Gui,Show,, DragonPad² -- %nTime% -- %Timez%
;ControlSetText, Static2,%timez%,DragonPad²
Return

; The updateclock function is courtesy of SKAN -- ONCE AGAIN!

;-----------------------------------------------------

Big_Go:
MsgBox,Make Sure Dragon is in Dictation Mode.`nTR in Append Mode and sound image is visible`npedal plugged in`ncommandlist ready for reference`nGet comfy`nMake sure Textpad window is open to %Mansarowar%`nOpen Dragonpad!
Send, ^{f12}
WinActivate, ahk_class Notepad++
WinActivate, ahk_class TalkpadClass
Sleep,24
ControlClick,Button1,DragonPad²
Return

;-----------------------------------------------------

Scrolllock:: ;;Winactivates DragonPad
WinActivate, ahk_class Notepad++
WinActivate, ahk_class TalkpadClass
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,d,ahk_class DgnBarMainWindowCls
Return

;-----------------------------------------------------

ButtonSpell:
;^#!s:: ;;send Dragon into Spell Mode
;WinActivate,ahk_class DgnBarMainWindowCls
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,s,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²

Return

ButtonNum:
;^#!n:: ;;send Dragon into Numbers  Mode
;WinActivate,ahk_class DgnBarMainWindowCls
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,u,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²

Return

ButtonDict:
;^#!d:: ;;send Dragon into Dictation Mode
;WinActivate,ahk_class DgnBarMainWindowCls
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,d,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²

Return

PigBodine:
^+#p::
WinGetPos,Zipi,Ditzah,Benny,Pig,DragonBar
SysGet,Gregory,61
SysGet,Peckory,62
;MsgBox,%Gregory% -- %Peckory%
Beer := Peckory
EnvDiv,Beer,3
;MsgBox,%Beer% `/ %Peckory%
Pig++
;MsgBox,Pig =  %Pig%
WinMove,ahk_class TalkpadClass,,0,%Pig%,%Gregory%,%Beer%
WinActivate,ahk_class TalkpadClass
Beer++
Dashiel := ( Beer + Pig )
;MsgBox,%Dashiel%
Bodine := ( Peckory - Dashiel )
;MsgBox,Bodine = %Bodine%
WinMove,ahk_class Notepad++
,,0,%Dashiel%,%Gregory%,%Bodine%
WinActivate,DragonPad²

Return

^+#!g::  ;;This is a command that performs some common corrections such as in this case removing any spaces before periods or question marks from the file in npp.  You can add any others. 
FileRead,Nuzzle,%Mansarowar%
StringReplace,Nuzzle,Nuzzle,%A_Space%?,?,All
StringReplace,Nuzzle,Nuzzle,%A_Space%.,.,All
FileDelete,%Mansarowar%
FileAppend,%Nuzzle%,%Mansarowar%
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++

Return

^#+t::
IfWinNotActive,ahk_class Notepad++
{
WinActivate,ahk_class Notepad++
ControlSend,,^!+0,ahk_class Notepad++
}
Else,
{
WinActivate,DragonPad²
ControlSend,RichEdit20A1,^{End},ahk_class TalkpadClass
}
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject: thank you! ^_^
PostPosted: July 1st, 2009, 10:34 pm 
Offline

Joined: July 1st, 2009, 9:13 pm
Posts: 16
I'm just familiarizing myself with both Dragon and AutoHotkey and am amazed and impressed by what you've done with the scripting. I am hoping to transition to using Dragon and possibly your DragonPad script for dictating my written work.

Have you by chance written replacements for the typical text maneuvering command such as page up and control-end? Not a big deal since one can switch between modes easily, but I'm interested on the off chance that you have.

Thank you kindly,

Ivo


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2009, 6:40 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Hi, I'm still working on this on and off, and am trying some different things. I made it so it now watches and copies all text in Dragonpad, the original one that came with Dragon, in hopes of maximum compatibility. I've added a few other minor features also, and just FYI I don't even use the "timed cut-n-paste" feature any more, and may discontinue it in the next version. Also, cut-n-paste is controlled with a pair of hotkeys, which I have programmed a typical transcriber's footpedal to send, so I perform all text copying by footpedal. You can do that too, or just use hotkeys if you like.

Other features include adding a copy of TRcontroller in the mix, which will control recording of the audio. If you don't want this feature it won't be difficult to comment out that part. But that is where I'm going with it.

And finally, my latest version uses Notepad++ to view the text after all macros have been performed on it. This is also strictly optional. You can modify it however you wish. I wrote it for my immediate use so I wrote it to work with what I had installed and liked. Shouldn't be difficult to modify. If you do so and like what you've created, pls. share your results. Also any constructive criticism will be appreciated. I'm certainly not an experienced scripter.

I've been advised against using so many other softwares if I want this program to be used by others, apparently. Actually my assumption is that if you can figure this mess out, you're smart enough to customize it
for yourself. ;-) And probably smart enough to improve on it too.

I think this is the latest version, and I think it works. Instuctions: start DNS, start DragonPad, start NPP, and then run this script. Total Recorder is optional I believe. Having a foot pedal is optional also but I really like it.

Here is the code, including my full list of DragonPad² commands.

Code:
#Persistent
settimer, update_clock, 50
SetKeyDelay, 1, 1
Grier = 0
Rosie =
nn =

;-----------------------------------------------------
;This is your command list.  You need to add new commands here for their scripts to execute.

Commandlist = atty1,atty2,atty3,atty4,atty5,atty6,@7,@8,@9,@10,@11,@12,@13,@14,@15,@16,nookey,cukey,dookie,foofter,cufter,doofter,noofter,rub-a-dub,peekwa,p-q-k,yesirree-bob,nosirree-bob,Yes-em,Noees,Sookie,Yuppers,By-Atty-1,By-Atty-2,By-Atty-3,By-Atty-4,By-Atty-5,By-Atty-6,delelast,Boobie,booby,semi-correct,semi-right,Baby-A,Baby-Q,BBQ,Dancy,fancy-dancey,DQ,Twa,semi-correct,okie-dokey,yeah-yeah-yeah,no-no-no,palooka,Yeah-baby,

Gooflist = hippity,booty,bootsie,bootie,bootsy,hizzoner,betelgeuse,,beetlejuice,token,paren-un,paren-nods-head,****,lazy-Jim,mama

Wordcount = 0

; DragonPad2 -- FREEWARE by ribbet.1 and many others who have taught me or provided code I've lifted from, especially but not exclusively Chris, Rajat, and SKAN!

; You are free to distribute this script, modify or compile it, and MAY NOT CHARGE MONEY FOR IT!

; I use this program with a footpedal. I've mapped the 3 switches to Ctrl-Alt-Shift-F10, Ctrl-F6 and Ctrl-F7.  The commands they initiate can be found further below.  You can easily remap them to a more convenient hotkey if you don't have a foot pedal. 

;-----------------------------------------------------

;GUI Creation

; Create the sub-menus for the menu bar:
DateTimeStamp=20061103000000
Menu, MyMenuBar, Add, &TimedCnP, TimedCutNpaste
Menu, MyMenuBar, Add, &STOPTimedCnP, StopTimedCutNpaste
Menu, MyMenuBar, Add, &SingleCnP, SingleCutNpaste
;Menu, MyMenuBar, Add, T&RC, TRC
Menu, MyMenuBar, Add, Big_&Go, Big_Go
;*  Menu, MyMenuBar, Add, &Bookmark, nBookmark
;* Menu, MyMenuBar, Add, TRCsaveAs, TRCsaveAs
Menu, MyMenuBar, Add, Panic, Panic


; Attach the menu bar to the window:
Gui, Menu, MyMenuBar

; Create the main Edit control and display the window:
Gui, Add, Button, x15  y4 w50 h18 vStartStop gStartStop, Start
Gui, Add, Button, x65  y4 w50 h18 vPauseResume gPauseResume, Pause
Gui, Add, Button, x115 y4 w50 h18 vReset gReset, Reset
Gui, Add, Button, x165 y4 w50 h18 vSpell vSpell, Spell
Gui, Add, Button, x215 y4 w50 h18 vNum vNum, Num
Gui, Add, Button, x265 y4 w50 h18 vDict vDict, Dict
Gui, Add, Button, x315 y4 w50 h18 vF12 vF12, F12
Gui, Add, Text, x386 y4 w91 h18 , 0 Words
Gui, Add, Button, x14 y24 w50 h18 , Record
Gui, Add, Button, x66 y24 w69 h18 , Bookmark
Gui, Add, Button, x136 y24 w69 h18 , Query
Gui, Add, Button, x207 y24 w50 h18 , Goto
Gui, Add, Button, x257 y24 w69 h18 , Goto_play
Gui, Add, Button, x329 y24 w50 h18 , Resume
Gui, Add, Button, x467 y24 w111 h18 , Bookmark_list
Gui, Add, Button, x380 y24 w85 h18 , Pauserecord
; Generated using SmartGUI Creator 4.0
;Gui, Show, x244 y246 h68 w656, New GUI Window

;Gui, Add, Text, x508 y8 w50 h20 +Center, 00:00:00
;Gui, Add, Text, x556 y8 w50 h20 +Center, 00:00:00
;Gui, Add, Text, x256 y8 w90 h20, 0 Words

Gui, Font, S12 CDefault, Verdana
CurrentFileName =  ; Indicate that there is no current file.
Gui,Show,x401 y40, DragonPad² -- START THE TIMER DUMMY
;-----------------------------------------------------
;Create textfile -- Default is DragonDictation-%A_MM%-%A_DD%.depo
; I have commented out the dialog that lets you select where your folder is to go.  That's just my preference.  Right now it creates a folder on the desktop and places the necessary files in it, no muss no fuss.  Uncomment the necessary lines to restore democracy.

;FileSelectFolder,Dusky,,2,Name the folder for your project -- Escape for default to %A_Desktop%\%A_MM%-%A_DD%\%A_MM%-%A_DD%
;If Dusky =
   {
   FileCreateDir,%A_Desktop%\%A_MM%-%A_DD%
   Dusky = %A_Desktop%\%A_MM%-%A_DD%
   }
   
;The following opens all logfiles and the depofile in NPP, depofile last

SetWorkingDir,%Dusky%
MsgBox,All files are located in %A_WorkingDir%
Mansarowar = %A_MM%-%A_DD%DragonDictation.depo
Fileappend, `n`[Started %A_MM%-%A_DD%-%A_Hour%:%A_Min%`]`n,%Mansarowar%
CurrentFiln = %A_MM%-%A_DD%Logfile.log
Fileappend, `nStarted %A_MM%-%A_DD%-%A_Hour%:%A_Min%`n,%CurrentFiln%
Run D:\Program Files\Notepad++\notepad++.exe %CurrentFiln%
Rosietext = %A_MM%-%A_DD%-Rosie.txt
FileAppend, `nStarted %A_MM%-%A_DD%-%A_Hour%:%A_Min% `n,%Rosietext%
Run D:\Program Files\Notepad++\notepad++.exe %Rosietext%
Dookie = %A_MM%-%A_DD%-TRClog.txt
FileAppend, `nStarted %A_MM%-%A_DD%-%A_Hour%:%A_Min% `n,%Dookie%
Film = %Dookie%
Run D:\Program Files\Notepad++\notepad++.exe %Film%


Gui,+AlwaysOnTop
Gui,Show,, DragonPad² -- START THE TIMER DUMMY
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,d,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,RichEdit20A1,^{End},ahk_class TalkpadClass

Run D:\Program Files\Notepad++\notepad++.exe %Mansarowar%

Gosub, PigBodine


IfWinExist,Reload
Controlclick,Button1,Reload


ControlGetText,Lakshmi,RichEdit20A1,ahk_class TalkpadClass
StringLen,LakshmiLen,Lakshmi
Stringlen,SaraLen,Sarasvati
;MsgBox,%Lakshmi% -- %LakshmiLen% -- %SaraLen%
if %LakshmiLen% = %SaraLen%
Return
else
Ganesa := ( LakshmiLen - SaraLen ) ;Ganesa represents the number of new characters

StringRight,Hanuman,Lakshmi,%Ganesa% ;Hanuman is those characters
StringReplace,Hanuman,Hanuman,%A_Space%%A_Space%,%A_Space%,All
StringReplace,Hanuman,Hanuman,%A_Space%.,.,All
StringReplace,Hanuman,Hanuman,%A_Space%?,?,All
FileAppend `n|%grier%| `t @%timez%@%ntime%@ -- %A_Space%%Hanuman%,%CurrentFiln% ; Appends Hanuman to logfile

Balaram := RegexReplace(Hanuman,"\s+"," ")

Loop,Parse,Balaram,%A_Space%, %A_Space%  ; parses based on A-Space as separator
{ ;333 This is where we separate words from commmands
AutoTrim,On
Kali = %A_Loopfield%
;If Kali in %Gooflist%
;*  { ;444 ;This is where commands are transferred to their respective gosubs
;* FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
;* Gosub, %Kali%
;* } ;444
;* Else
;* If Kali in %Commandlist%
;* { ;444 ;This is where commands are transferred to their respective gosubs
;* Grier++ ;This increments var Grier
;* FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
;* Gosub, %Kali%
;* } ;444
;* Else
;*  FileAppend,%Kali%%A_Space%,%Mansarowar%  ;This appends to the dictation textfile
Durga = %A_Index%
If A_Loopfield !=
++Wordcount
GuiControlGet, static1
If ( static1 <> Wordcount )            ; Update the control only when needed
GuiControl,, static1, %Wordcount% words  ; this avoids flicker
;Sleep, 2000

}

Sarasvati := Lakshmi
WinActivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{End},ahk_class TalkpadClass

Return

GuiClose:
ExitApp


Panic:
Reload
Return

Pause::Pause
;-----------------------------------------------------

2ButtonOK:  ; This section is used by the "about box" above.
2GuiClose:
2GuiEscape:
Gui, 1:-Disabled  ; Re-enable the main window (must be done prior to the next step).
Gui Destroy  ; Destroy the about box.
return
;-----------------------------------------------------
;This begins the DragonPad² functions
;-----------------------------------------------------
^+#d::  ;;Activate DragonPad²
IfWinNotActive,DragonPad²
WinActivate,DragonPad²
else,
WinMinimize,DragonPad²
Return
;-----------------------------------------------------
STOPTimedCutNpaste:
^numpad6::  ;Stop timed cutnpaste
stop = 1
Sleep,200
;Pause
;Return
WinActivate,ahk_class TalkpadClass
Return
;-----------------------------------------------------
ButtonF12: ;;Turns mic on in Dragon
ControlClick,Button6,ahk_class DgnBarMainWindowCls
Return
;-----------------------------------------------------
 
SingleCutNpaste:
^numpad4::  ;;Init Single CutNPaste

ControlGetText,Lakshmi,RichEdit20A1,ahk_class TalkpadClass
StringLen,LakshmiLen,Lakshmi
Stringlen,SaraLen,Sarasvati
;MsgBox,%Lakshmi% -- %LakshmiLen% -- %SaraLen%
if %LakshmiLen% = %SaraLen%
Return
else
Ganesa := ( LakshmiLen - SaraLen ) ;Ganesa represents the number of new characters

StringRight,Hanuman,Lakshmi,%Ganesa% ;Hanuman is those characters
StringReplace,Hanuman,Hanuman,%A_Space%%A_Space%,%A_Space%,All
StringReplace,Hanuman,Hanuman,%A_Space%.,.,All
StringReplace,Hanuman,Hanuman,%A_Space%?,?,All
FileAppend `n|%grier%| `t @%timez%@%ntime%@ -- %A_Space%%Hanuman%,%CurrentFiln% ; Appends Hanuman to logfile

Balaram := RegexReplace(Hanuman,"\s+"," ")

Loop,Parse,Balaram,%A_Space%, %A_Space%  ; parses based on A-Space as separator
{ ;333 This is where we separate words from commmands
AutoTrim,On
Kali = %A_Loopfield%
If Kali in %Gooflist%
{ ;444 ;This is where commands are transferred to their respective gosubs
FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
Gosub, %Kali%
} ;444
Else
If Kali in %Commandlist%
{ ;444 ;This is where commands are transferred to their respective gosubs
Grier++ ;This increments var Grier
FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
Gosub, %Kali%
} ;444
Else
FileAppend,%Kali%%A_Space%,%Mansarowar%  ;This appends to the dictation textfile
Durga = %A_Index%
If A_Loopfield !=
++Wordcount
GuiControlGet, static1
If ( static1 <> Wordcount )            ; Update the control only when needed
GuiControl,, static1, %Wordcount% words  ; this avoids flicker
;Sleep, 2000
Sarasvati := Lakshmi

} ;333

ControlSend,,^+2,ahk_class Notepad++  ;note: create a "reopen from disk" (i.e., refresh) hotkey for npp in its preferences dialog

ControlSend,,^+!0,ahk_class Notepad++  ;note: create a "goto bottom" macro in npp's macro recorder and save with this hotkey ;-)

;I may have got these mixed up. 
;Winactivate,ahk_class Notepad++
WinActivate,ahk_class TalkpadClass 
ControlSend,RichEdit20A1,`n`n,ahk_class TalkpadClass 

Return
;-----------------------------------------------------
TIMEDCUTNPASTE:
^numpad0::  ;;Init timed CutNPaste
stop = 0
Winactivate, ahk_class TalkpadClass
SetKeyDelay, 1, 1
Loop
{ ;111 This is the main loop that contains all others
Winactivate,ahk_class TalkpadClass
if stop = 1
break
else
Lakshmi =
Gosub,CutNPaste
GuiControlGet, Static1
If ( Static1 <> Wordcount )            ; Update the control only when needed
GuiControl,, Static1, %Wordcount% words  ; this avoids flicker
Sleep, 2000
Sarasvati := Lakshmi
} ;111

Return


^+#Backspace::  ;;Exit
ExitApp
Return

;-----------------------------------------------------
CutNPaste:

Loop
{  ;222 This loop just waits for input in the main edit
if stop = 1
break
else
ControlGetText,Lakshmi,RichEdit20A1,ahk_class TalkpadClass
StringLen,LakshmiLen,Lakshmi
Stringlen,SaraLen,Sarasvati
;MsgBox,%Lakshmi% -- %LakshmiLen% -- %SaraLen%
if %LakshmiLen% = %SaraLen%
Sleep, 250
else
break
}  ;222
Ganesa := ( LakshmiLen - SaraLen ) ;Ganesa represents the number of new characters
;MsgBox,%Ganesa%
StringRight,Hanuman,Lakshmi,%Ganesa% ;Hanuman is those characters
;MsgBox,%Hanuman%

FileAppend `n|%grier%| {tab} @%timez%@%ntime%@ -- %A_Space%%Hanuman%,%CurrentFiln% ; Appends Hanuman to logfile

Balaram := RegexReplace(Hanuman,"\s+"," ")

;MsgBox,%Balaram%
Loop,Parse,Balaram,%A_Space%, %A_Space%  ; parses based on A-Space as separator
{ ;333 This is where we separate words from commmands
AutoTrim,On
Kali = %A_Loopfield%
;MsgBox,Kali = %Kali%
If Kali in %Gooflist%
{ ;This is where commands are transferred to their respective gosubs
FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
Gosub, %Kali%
}
Else
If Kali in %Commandlist%
{ ;This is where commands are transferred to their respective gosubs
Grier++ ;This increments var Grier
FileAppend, `n|%Grier%|@%timez%@%ntime%@ -- %A_Space%%Kali%,%CurrentFiln%
Sleep,50 ;may not be necessary, I don't remember
Gosub, %Kali%
}
Else
FileAppend,%Kali%%A_Space%,%Mansarowar% ;This appends to the dictation textfile
Durga = %A_Index%
If A_Loopfield !=
++Wordcount
; }
} ;333
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Winactivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
;ControlSend,RichEdit20A1,`n`n,ahk_class TalkpadClass
Return

;This is the footpedal hotkey. 
;-----------------------------------------------------
;These are utility hotkeys for use by footpedal

^+!f10:: ;;Activate Npp, goto bottom, reactivate DragonPad
IfwinNotActive,ahk_class Notepad++
{
Winactivate,ahk_class Notepad++
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
}
WinActivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
;ControlSend,,`n`n,DragonPad²
Return

^F7::
;Send,^{F12}
ControlSend,,^+2,ahk_class Notepad++ ;This is mapped to "reload from disk" in NPP
ControlSend,,^+!0,ahk_class Notepad++  ;   I made the simplest of all macros for NPP -- goto bottom :-) and gave it this hotkey.
WinActivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
Return

^F6::
Gosub,SingleCutNpaste
Winactivate,ahk_class Notepad++
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
WinActivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
ControlSend,,^+!0,ahk_class Notepad++
Return

^+#f6::  ;;Just put a couple carriage returns in DragonPad²
ControlSend,,^+!0,ahk_class Notepad++

ControlSend,RichEdit20A1,`n`n,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{End},ahk_class TalkpadClass
Return

;-----------------------------------------------------
;-----------------------------------------------------
;Begins the commands proper

atty1:
;MsgBox, Command = Atty1
Gosub,ButtonBOOKMARK
FileAppend,[%Grier%|@%timez%@%ntime%@]`n%A_Tab%%A_Tab%%A_Tab%Atty.1:*.%A_Space%%A_Space%,%Mansarowar%
Return

atty2:
;MsgBox, Command = Atty2
Gosub,ButtonBOOKMARK
FileAppend,[%Grier%|@%timez%@%ntime%@]`n%A_Tab%%A_Tab%%A_Tab%Atty.2:*.%A_Space%%A_Space%,%Mansarowar%
Return

atty3:
;MsgBox, Command = Atty3
Gosub,ButtonBOOKMARK
FileAppend,[%Grier%|@%timez%@%ntime%@]`n%A_Tab%%A_Tab%%A_Tab%Atty.3:*.%A_Space%%A_Space%,%Mansarowar%
Return

atty4:
;MsgBox, Command = Atty4
Gosub,ButtonBOOKMARK
FileAppend,[%Grier%|@%timez%@%ntime%@]`n%A_Tab%%A_Tab%%A_Tab%Atty.4:*.%A_Space%%A_Space%,%Mansarowar%
Return

atty5:
;MsgBox, Command = Atty5
Gosub,ButtonBOOKMARK
FileAppend,[%Grier%|@%timez%@%ntime%@]`n%A_Tab%%A_Tab%%A_Tab%Atty.5:*.%A_Space%%A_Space%,%Mansarowar%
Return

atty6:
;MsgBox, Command = Atty6
Gosub,ButtonBOOKMARK
FileAppend,[%Grier%|@%timez%@%ntime%@]`n%A_Tab%%A_Tab%%A_Tab%Atty.6:*.%A_Space%%A_Space%,%Mansarowar%
Return

nookey:  ;;q-tab
Gosub,ButtonBOOKMARK
   FileAppend,[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space% %A_Space%,%Mansarowar%
   Return

Baby-Q:
Gosub,ButtonBOOKMARK
   FileAppend,[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space% %A_Space%,%Mansarowar%
   Return

BBQ:
Gosub,ButtonBOOKMARK
   FileAppend,[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space% %A_Space%,%Mansarowar%
   Return

cukey:  ;;q-q-tab
Gosub,ButtonBOOKMARK
   FileAppend,?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space% %A_Space%,%Mansarowar%
   Return

dookie:  ;;dash-q-tab
Gosub,ButtonBOOKMARK
   FileAppend,%A_Space%--%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space% %A_Space%,%Mansarowar%
   Return

spooky:  ;;dash-q-tab
Gosub,ButtonBOOKMARK
   FileAppend,%A_Space%--%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

foofter:  ;;a-tab
Gosub,ButtonBOOKMARK
   FileAppend,%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

Baby-A:  ;;A-tab
Gosub,ButtonBOOKMARK
   FileAppend,%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

cufter:  ;;q-a-tab
Gosub,ButtonBOOKMARK
   FileAppend, ?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

noofter:  ;;p-a-tab
Gosub,ButtonBOOKMARK
   FileAppend, . %A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

doofter:  ;;dash-a-tab
Gosub,ButtonBOOKMARK
   FileAppend, ^%A_Space%--%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

boobie:  ;;full-stop
   FileAppend,.%A_Space% %A_Space%,%Mansarowar%
   Return

booby:  ;;full-stop
   FileAppend,.%A_Space% %A_Space%,%Mansarowar%
   Return

hizzoner:  ;;the court
;Gosub,ButtonBOOKMARK
   FileAppend,`n%A_Tab%%A_Tab%%A_Tab%THE COURT:*.%A_Space%%A_Space%,%Mansarowar%
   Return

peekwa:  ;;p-q-tab
Gosub,ButtonBOOKMARK
      FileAppend,.%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space% %A_Space%,%Mansarowar%
   Return

Yes-em:  ;;Q-A-tab - Yes - P-Q-Tab
Gosub,ButtonBOOKMARK
      FileAppend,?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space% Yes. `n%A_Tab%Q*.%A_Space%,%Mansarowar%
   Return

okie-dokey:  ;;P-A-tab - Okay - P-Q-Tab
Gosub,ButtonBOOKMARK
      FileAppend,.%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space% Okay. `n%A_Tab%Q*.%A_Space%,%Mansarowar%
   Return

yesirree-bob:  ;;Q-A-tab - Yes - P-Q-Tab
Gosub,ButtonBOOKMARK
      FileAppend,?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space% Yes. `n%A_Tab%Q*.%A_Space%,%Mansarowar%
   Return

yeah-yeah-yeah:  ;;Q-A-tab - Yes -
Gosub,ButtonBOOKMARK
      FileAppend,?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space% Yes%A_Space%,%Mansarowar%
   Return

nosirree-bob:  ;;Q-A-tab - No - P-Q-Tab
Gosub,ButtonBOOKMARK
      FileAppend,?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space% No. `n%A_Tab%Q*.%A_Space%,%Mansarowar%
   Return

no-no-no:  ;;Q-A-tab - No -
Gosub,ButtonBOOKMARK
      FileAppend,?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space% No%A_Space%,%Mansarowar%
   Return

noees:  ;;Q-A-tab - No - P-Q-Tab
Gosub,ButtonBOOKMARK
      FileAppend,?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space% No. `n%A_Tab%Q*.%A_Space%,%Mansarowar%
   Return

Yuppers:  ;;Q-A-tab - Uh-huh - P-Q-Tab
Gosub,ButtonBOOKMARK
FileAppend,?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space%%A_Space%uh-huh.%A_Space%%A_Space%`n%A_Tab%Q*.%A_Space%%A_Space%,%Mansarowar%
   Return

p-q-k:  ;;P-Q-Tab - Okay.
Gosub,ButtonBOOKMARK
FileAppend,.%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space%%A_Space%Okay.,%Mansarowar%
   Return

palooka:  ;;P-Q-Tab - Uh-huh -- A-tab.
Gosub,ButtonBOOKMARK
FileAppend,.%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space%%A_Space%Uh-huh? `n%A_Tab%A*.%A_Space%,%Mansarowar%
   Return

By-Atty-1:   ;;By Atty 1
Gosub,ButtonBOOKMARK
   FileAppend,`n%A_Tab%%A_Tab%%A_Tab%[%Grier%|@%timez%@%ntime%@]%A_Space%BY *ATTY1:*`n%A_Tab%Q*.%A_Space%%A_Space%,%Mansarowar%
   Return

By-Atty-2:  ;;By Atty 2
Gosub,ButtonBOOKMARK
   FileAppend,`n%A_Tab%%A_Tab%%A_Tab%[%Grier%|@%timez%@%ntime%@]%A_Space%BY *ATTY2:*`n%A_Tab%Q*.%A_Space%%A_Space%,%Mansarowar%
   Return

By-Atty-3:  ;;By Atty 3
Gosub,ButtonBOOKMARK
   FileAppend,`n%A_Tab%%A_Tab%%A_Tab%[%Grier%|@%timez%@%ntime%@]%A_Space%BY *ATTY3:*`n%A_Tab%Q*.%A_Space%%A_Space%,%Mansarowar%
   Return

By-Atty-4:  ;;By Atty 4
Gosub,ButtonBOOKMARK
   FileAppend,`n%A_Tab%%A_Tab%%A_Tab%[%Grier%|@%timez%@%ntime%@]%A_Space%BY *ATTY4:*`n%A_Tab%Q*.%A_Space%%A_Space%,%Mansarowar%
   Return

by-Atty-5:  ;;By Atty 5
Gosub,ButtonBOOKMARK
   FileAppend,`n%A_Tab%%A_Tab%%A_Tab%[%Grier%|@%timez%@%ntime%@]%A_Space%BY *ATTY5:*`n%A_Tab%Q*.%A_Space%%A_Space%,%Mansarowar%
   Return

By-Atty-6:  ;;By Atty 6
Gosub,ButtonBOOKMARK
   FileAppend,`n%A_Tab%%A_Tab%%A_Tab%[%Grier%|@%timez%@%ntime%@]%A_Space%BY *ATTY6:*`n%A_Tab%Q*.%A_Space%%A_Space%,%Mansarowar%
   Return

semi-correct:  ;;Semi-is that correct - Q-A-Tab
Gosub,ButtonBOOKMARK
   FileAppend, `;is that correct?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

semi-right:  ;;Semi-is that right - Q-A-Tab
Gosub,ButtonBOOKMARK
   FileAppend, `;is that right?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

paren-un:  ;;(unintelligible)
Gosub,ButtonQUERY
   FileAppend,`(unintelligible|@%timez%@%ntime%@|`),%Mansarowar%
   Return
   
****:  ;;(unintelligible)
Gosub,ButtonQUERY
   FileAppend,`(unintelligible|@%timez%@%ntime%@|`),%Mansarowar%
   Return
   
P-P:  ;;Period-Paragraph
;Gosub,ButtonBOOKMARK
   FileAppend,.%A_Space%%A_Space%`n%A_Tab%,%Mansarowar%
   Return
   
Bootie:  ;;Period
;Gosub,ButtonBOOKMARK
   FileAppend,.%A_Space%%A_Space%,%Mansarowar%
   Return   

Booty:  ;;Period
;Gosub,ButtonBOOKMARK
   FileAppend,.%A_Space%%A_Space%,%Mansarowar%
   Return
   
Bootsie:  ;;?
;Gosub,ButtonBOOKMARK
   FileAppend,?%A_Space%%A_Space%,%Mansarowar%
   Return
   
Bootsy:  ;;?
;Gosub,ButtonBOOKMARK
   FileAppend,?%A_Space%%A_Space%,%Mansarowar%
   Return

token:  ;;@@TOKEN@@
Gosub,ButtonQUERY
   FileAppend,`@``@TOKEN|@%timez%@%ntime%@|``@`@%A_Space%%A_Space%,%Mansarowar%
   Return

fancy-dancey:  ;;Dash-A-Tab
Gosub,ButtonBOOKMARK
   FileAppend,--%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

Dancy:  ;;Dash-A-Tab
Gosub,ButtonBOOKMARK
   FileAppend,--%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%A*.%A_Space% %A_Space%,%Mansarowar%
   Return

DQ:  ;;Dash-Q-Tab
Gosub,ButtonBOOKMARK
   FileAppend,--%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space% %A_Space%,%Mansarowar%
   Return

Twa:  ;;THE WITNESS:*.
Gosub,ButtonBOOKMARK
   FileAppend,--%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%THE%A_Space%WITNESS*.%A_Space% %A_Space%,%Mansarowar%
   Return

lazy-Jim:
   FileAppend,ladies and gentlemen of the jury,%Mansarowar%
   Return

Yeah-baby:
Gosub,ButtonBOOKMARK
   FileAppend,?%A_Space%%A_Space%[%Grier%|@%timez%@%ntime%@]`n%A_Tab%Q*.%A_Space% %A_Space%Uh-huh?`n%A_Tab% %A_Tab% A*.%A_Space%,%Mansarowar%
   Return
   
mama:
   FileAppend,uh-huh.,%Mansarowar%
   Return
   

;=== The killswitch shortcut (Ctrl-Alt-Win-Backspace)

^!#Backspace::Reload

;-----------------------------------------------------
;-----------------------------------------------------
;This is the stopwatch

StartStop:

 GuiControlGet, StartStop
 If ( StartStop = "Start" )
  {
     GuiControl,, StartStop, Stop
     SetTimer, Count,990
  }
 Else
  {
     GuiControl,, StartStop, Start
     SetTimer, Count, Off
     GuiControl,, PauseResume, Pause
     DateTimeStamp = 20061103000000

  }
Return

PauseResume:

 GuiControlGet, StartStop
 If ( StartStop = "Start" )
     Return
 GuiControlGet, PauseResume
 If ( PauseResume = "Pause" )
  {
     GuiControl,, PauseResume, Resume
     SetTimer, Count, OFF
  }
 Else
  {
     GuiControl,, PauseResume, Pause
     SetTimer, Count, 990
  }
Return

Reset:

  ;sGuiControl,, Static1, 00:00:00
  Gui,Show,, DragonPad² -- 00:00:00 -- %Timez%
  DateTimeStamp = 20061103000000
Return


Count:

DateTimeStamp += 1, Seconds
FormatTime, nTime, %DateTimeStamp%, HH:mm:ss
;GuiControlGet, Static1
If ( nDoze <> nTime )            ; Update the control only when needed
{
Gui,Show,NoActivate, DragonPad² -- %nTime% -- %Timez%
;GuiControl,, Static1, %nTime%  ; this avoids flicker
}
nDoze := nTime
Return

update_clock:

FormatTime, timez,, HH:mm:ss
;Gui,Show,, DragonPad² -- %nTime% -- %Timez%
;ControlSetText, Static2,%timez%,DragonPad²
Return

; The updateclock function is courtesy of SKAN -- ONCE AGAIN!

;-----------------------------------------------------

Big_Go:
IfWinNotExist,ahk_class TotalRecorderWndClass
{
Run,"D:\Program Files\HighCriteria\TotalRecorder\TotalRecorder.exe"
WinWaitActive,ahk_class TotalRecorderWndClass
}
MsgBox,Make Sure Dragon is in Dictation Mode.`nTR in Append Mode and sound image is visible`npedal plugged in`ncommandlist ready for reference`nGet comfy`nMake sure Textpad window is open to %Mansarowar%`nOpen Dragonpad!
Send, ^{f12}
WinActivate, ahk_class Notepad++
WinActivate, ahk_class TalkpadClass
Sleep,24
ControlClick,Button1,DragonPad²
ControlClick,Button20,ahk_class TotalRecorderWndClass
Return

;-----------------------------------------------------

Scrolllock:: ;;Winactivates DragonPad
WinActivate, ahk_class Notepad++
WinActivate, ahk_class TalkpadClass
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,d,ahk_class DgnBarMainWindowCls
Return

;-----------------------------------------------------

ButtonSpell:
;^#!s:: ;;send Dragon into Spell Mode
;WinActivate,ahk_class DgnBarMainWindowCls
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,s,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²

Return

ButtonNum:
;^#!n:: ;;send Dragon into Numbers  Mode
;WinActivate,ahk_class DgnBarMainWindowCls
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,u,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²

Return

ButtonDict:
;^#!d:: ;;send Dragon into Dictation Mode
;WinActivate,ahk_class DgnBarMainWindowCls
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,d,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²

Return

PigBodine: ;This places all the windows for my workspace
^+#p::
WinGetPos,Zipi,Ditzah,Benny,Pig,DragonBar
SysGet,Gregory,61
SysGet,Peckory,62
;MsgBox,%Gregory% -- %Peckory%
Beer := Peckory
EnvDiv,Beer,3
;MsgBox,%Beer% `/ %Peckory%
Pig++
;MsgBox,Pig =  %Pig%
WinMove,ahk_class TalkpadClass,,0,%Pig%,%Gregory%,%Beer%
WinActivate,ahk_class TalkpadClass
Beer++
Dashiel := ( Beer + Pig )
;MsgBox,%Dashiel%
Bodine := ( Peckory - Dashiel )
;MsgBox,Bodine = %Bodine%
WinMove,ahk_class Notepad++
,,0,%Dashiel%,%Gregory%,%Bodine%
WinActivate,DragonPad²

Return

^+#!g::  ;;This is a command that performs some common corrections such as in this case removing any spaces before periods or question marks from the file in npp.  You can add any others. 
FileRead,Nuzzle,%Mansarowar%
StringReplace,Nuzzle,Nuzzle,%A_Space%?,?,All ;Eliminates spaces before question marks
StringReplace,Nuzzle,Nuzzle,%A_Space%.,.,All ;Eliminates spaces before periods
StringReplace,Nuzzle,Nuzzle,%A_Space%`r`n,`r`n,All ;Eliminates spaces at end of lines
StringReplace,Nuzzle,Nuzzle,`r`n`r`n,`r`n,All ;Eliminates blank lines, one hopes
StringReplace,Nuzzle,Nuzzle,`*.,%A_Tab%,All ;Replaces the "*." with a tab
FileDelete,%Mansarowar%
FileAppend,%Nuzzle%,%Mansarowar%
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++

Return

^#+t::
IfWinNotActive,ahk_class Notepad++
{
WinActivate,ahk_class Notepad++
ControlSend,,^!+0,ahk_class Notepad++
}
Else,
{
WinActivate,DragonPad²
ControlSend,RichEdit20A1,^{End},ahk_class TalkpadClass
}
Return

^+!#s::  ;;This deletes all timestamps
FileRead,Nuzzle, %Mansarowar%
Mutter := RegExReplace(Nuzzle,"\[.*?\]","")
FileDelete,%Mansarowar%
FileAppend,%Mutter%,%Mansarowar%
ControlSend,,^+2,ahk_class Notepad++
ControlSend,,^+!0,ahk_class Notepad++
Return

^+#!d:: ;; Send Mansarowar to WP one key at a time
IfWinExist,ahk_class WordPerfect.12.00
{
WinActivate,ahk_class WordPerfect.12.00
ControlSend,WPDocClient1,^{End},WordPerfect
Sleep,100
FileRead,Nuzzle,*t %Mansarowar%
ControlSend,WPDocClient1,%Nuzzle%,WordPerfect
}
Return



;-----------------------------------------------------
;-----------------------------------------------------

;Here begins the new TRC script:


ButtonQuery:
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
FileAppend, `nM%Rosie% - %Timex% -- %timey% -- QUERY,%Film%
M%Rosie% := Timex
Pinky = %Rosie%
Return


ButtonBOOKMARK:
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
FormatTime, timey,, HH:mm:ss
FileAppend, `nM%Rosie% - %Timex% -- %timey%,%Film%
M%Rosie% := Timex
Pinky = %Rosie%
Return

ButtonRecord:
Rosie++
ControlGetText,Timex,Static8,ahk_class TotalRecorderWndClass
M%Rosie% := Timex
ControlClick,Button20,ahk_class TotalRecorderWndClass
WinClose,%Film% - Notepad
FileAppend, `nM%Rosie% - %Timex%,%Film%
Pinky = %Rosie%
Return

ButtonGoto_play:
Gosub, Backup
Sleep,30
ControlClick,Button16,ahk_class TotalRecorderWndClass
Return

ButtonGoto:
Gosub, Backup
Return

Backup:
Pinky--
Mnn := M%Pinky%
ControlClick,Button19,ahk_class TotalRecorderWndClass
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
WinWaitActive,Jump to time
ControlSetText,Edit1,%Mnn%,Jump to time
ControlClick,Button3,Jump to time
Sleep,30
If Pinky < 1
{
Msgbox,,2,Out of bookmarks!,.5
Pinky = %Rosie%
}
Return

JumpBox:
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
Return

ButtonBookmark_list:
IfWinNotExist,%Film% - Notepad
{
Run Notepad %Film%
WinWaitActive,%Film% - Notepad
ControlSend,,^{End},%Film% - Notepad
Return
}
Else
WinKill, %Film% - Notepad
Return

ButtonResume:
nn = 1
ControlClick,Button14,ahk_class TotalRecorderWndClass
Sleep,40
ControlClick,Button20,ahk_class TotalRecorderWndClass
Return

^#c:: ;;This sends highlighted text to the TR jumpbox and presses OK
Send,^c
Bubba := Clipboard
Sleep,300
ControlClick,ToolBarWindow324,ahk_class TotalRecorderWndClass
WinWaitActive,Jump to time
ControlSetText,Edit1,%Bubba%,Jump to time
ControlClick,Button3,Jump to time
Return

ButtonPauserecord:
ControlClick,Button18,ahk_class TotalRecorderWndClass
Return



Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 3rd, 2009, 6:04 pm 
Offline

Joined: July 1st, 2009, 9:13 pm
Posts: 16
Impressive! I think I'll need to work on something more general purpose in normal mode, however the wealth of information you've provided through this script will make working with AutoHotkey and Dragon much easier.

Do you by chance have any thoughts regarding the capture of Dragon commands? At first examination it seems like Dragon mostly sends virtual keystroke messages and I'm not sure if there's a way in AutoHotkey to do anything about them, for example saying "page-up two" is, I think, sent as a keystroke followed by a paste of the word 'two'.

Thanks a lot. ^_^


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 5th, 2009, 1:02 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
IvoLucien wrote:
Do you by chance have any thoughts regarding the capture of Dragon commands? At first examination it seems like Dragon mostly sends virtual keystroke messages and I'm not sure if there's a way in AutoHotkey to do anything about them, for example saying "page-up two" is, I think, sent as a keystroke followed by a paste of the word 'two'.

Thanks a lot. ^_^


You should look at the big thread re Dragon, if you have not already. Some of the OP's thoughts in the first post address this question. It's here:

http://www.autohotkey.com/forum/viewtop ... agonpad%B2

Let me know how it works for you. ;-)

My big idea of this DragonPad² project is to eliminate using Dragon commands, and instead use AHK commands. The pause you get whenever you tell Dragon to do something is too much for me to bear, so I made this instead. I use this script, Dragon in dictation mode only, and automatic formatting turned off too. I use my custom AHK macros to provide punctuation and formatting.

Cheers. ribbet, ribbet


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 15th, 2009, 3:57 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
I've done pretty much a complete rewrite. Surely it can use more improvements, but this is much better IMO. I've subtracted the need for an external text viewer (it was notepad++) and I've removed the part that works with Total Recorder.

    * So this is a completely standalone version, with its own built in text viewer, and a few new features I've been playing with.
    * I've mapped 9 of the most important commands to user-selectable hotkeys. (USB numpad sounds nice for this)
    * All DragonPad² commands are viewable as a HTML document in your default browser.
    * All DragonPad² commands are now loaded from an external .ini file, so the script can now be compiled, and the commands may be edited and added. And you can have separate command .ini files if you want.

May have minor bugs still. I'd like to hear from you if you find one.

Basic usage is this: you create a list of DragonPad² commands, using standard ahk syntax. See example command list below. Then you add these commands to Dragon as custom words and train them. Then when the word is dictated into DragonPad (the original) and copied into DragonPad², every word is checked against the commandlist and notimes, and if in the list, the text from that command is sent to DragonPad² in place of the word. If the command is in the commandlist and not the notimes list, a timestamp is appended as well. Advantages over custom words? Among other things you can include carriage returns. Advantage over Dragon text commands? Speed. Or at least in my experience with Dragon ver. 8 and 9, using P4 and 2.5-3ghz core 2 duo computers.

My specific intention was to speed up legal/whatever transcription using Dragon by replacing compound punctuation/formatting elements that are pretty much the same in all legal transcripts, without having to use Dragon's macro functionality which in my experience slows things down too much, especially if you are trying to transcribe at 140+ wpm. There are several rather expensive commercial applications being sold to court reporters and the like which admittedly do a lot more than this thing does. But the core functionality for all of them may include something like this. But I'm just guessing really. I've not seen that many of them in operation. But at one point I was kind of offended that a single program for court reporters and transcribers may set you back over $1000 for a single license. Hence this project.

Code:
#NoEnv
#Persistent
settimer, update_clock, 50
SetKeyDelay, 11, 11
Grier = 0


MsgBox,You need to have Dragon and DragonPad up and running before proceeding further. 
;-----------------------------------------------------
Read_hokeys: ;Need to add a menu to view this again
IfExist, %A_ScriptDir%\Dpad.ini ; dpad.ini is where the hokeys are being stored
Loop,9
{
IniRead, hokey%A_Index%,%A_ScriptDir%\Dpad.ini,S%A_Index%,ehk%A_Index%,^Numpad%A_Index%
INiRead, V%A_Index%,%A_ScriptDir%\Dpad.ini,S%A_Index%,V%A_Index%,1
If ERROR = 1
ehk%A_Index% =
}
Gosub, 2ButtonSubmit
;Return

;Create textfile -- Default is DragonDictation-%A_MM%-%A_DD%.depo
; I have commented out the dialog that lets you select where your folder is to go.  It presently creates a folder on desktop and puts all folders there without option.  Uncomment the necessary lines to restore democracy.

;FileSelectFolder,Dusky,,2,Name the folder for your project -- Escape for default to %A_Desktop%\%A_MM%-%A_DD%\%A_MM%-%A_DD%
If Dusky =
   {
   FileCreateDir,%A_Desktop%\%A_MM%-%A_DD%
   Dusky = %A_Desktop%\%A_MM%-%A_DD%
   }
   
CurrentFiln = %Dusky%\%A_MM%-%A_DD%DragonDictation.log ; This is the logfile
Mns = %Dusky%\%A_MM%-%A_DD%DragonDictation.depo ; This is the transcript
Fileappend, `n`[Started %A_MM%-%A_DD%-%A_Hour%:%A_Min%`]`n,%Mns%
Fileappend, `nStarted %A_MM%-%A_DD%-%A_Hour%:%A_Min%`n,%CurrentFiln%
;-----------------------------------------------------
; The following will read the names of the commands into the commandlist var.  This can be improved later.
FileSelectFile,IniIni,3,%A_ScriptDir%\DD.ini ,Select command File for DragonPad²,*.ini
IF IniIni =
ExitApp
IniRead,Commandlist,%IniIni%,Commands,Commandlist
IniRead,NoTimeList,%IniIni%,NoTimes,NoTimeList
Caplist = .,?,:,%A_Tab%,]

Wordcount = 0

; DragonPad2 -- FREEWARE by ribbet.1 and many others who have taught me or provided code I've lifted from, especially but not exclusively Chris, Rajat, and SKAN!
; You are free to distribute this script, modify or compile it, and MAY NOT CHARGE MONEY FOR IT!

;-----------------------------------------------------

;GUI Creation
; Create the sub-menus for the menu bar:
DateTimeStamp=20061103000000
Gui, +Resize ; Make the window resizable.
Menu, MyMenuBar, Add, TimedCnP, TimedCutNpaste
Menu, MyMenuBar, Add, STOPTimedCnP, StopTimedCutNpaste
Menu, MyMenuBar, Add, SingleCnP, SingleCutNpaste
Menu, MyMenuBar, Add, Hkeys, Hkeys
Menu, MyMenuBar, Add, Panic, Panic
;Menu, MyMenuBar, Add, Cleanup, Cleanup
Menu, MyMenuBar, Add, Resend, Resend
Menu, MyMenuBar, Add, View Commands, ViewCommands
Menu, MyMenuBar, Add, CleanupCommands, CleanupCommands
Menu, FileMenu, Add, Open With, OpenWith
Menu, FileMenu, Add, Save, Filesave
Menu, MyMenuBar, Add, File, :FileMenu
Gui, Menu, MyMenuBar

; Create the main Edit control and display the window:
Gui, Add, Button, x15  y4 w50 h18 vStartStop gStartStop, Start
Gui, Add, Button, x65  y4 w50 h18 vPauseResume gPauseResume, Pause
Gui, Add, Button, x115 y4 w50 h18 vReset gReset, Reset
Gui, Add, Button, x165 y4 w50 h18 vSpell vSpell, Spell
Gui, Add, Button, x215 y4 w50 h18 vNum vNum, Num
Gui, Add, Button, x265 y4 w50 h18 vDict vDict, Dict
Gui, Add, Button, x315 y4 w50 h18 vF12 vF12, F12
Gui, Add, Text, x386 y4 w91 h18 , 0 Words
Gui, Font, S12 CDefault, Courier New
Gui, Add, Edit, x20 y30 WantTab vMainEdit +Wrap; H260 W500
; Generated using SmartGUI Creator 4.0

CurrentFileName =  ; Indicate that there is no current file.
Gui, Show, Center Autosize, DragonPad² -- TIMER NOT STARTED
Gosub, PigBodine
Gosub, FileRead
Gui, Show, , DragonPad² -- TIMER NOT STARTED
Return
;-----------------------------------------------------

GuiSize:
if ErrorLevel = 1  ; The window has been minimized.  No action needed.
return
; Otherwise, the window has been resized or maximized. Resize the Edit control to match.
Fritz:
NewWidth := A_GuiWidth - 20
NewHeight := A_GuiHeight - 20
2NewWidth := A_GuiWidth - 38
2NewHeight := A_GuiHeight - 40
GuiControl, Move, DragonPad², W%NewWidth% H%NewHeight%
GuiControl, Move, MainEdit, W%2NewWidth% H%2NewHeight%
;-----------------------------------------------------
return

;*  Gui,+AlwaysOnTop
;* Gui,Show,, DragonPad² -- START THE TIMER DUMMY
;* ControlClick,Button3,ahk_class DgnBarMainWindowCls
;* ControlSend,,d,ahk_class DgnBarMainWindowCls
;* WinActivate, DragonPad²
;* ControlClick,Edit1,DragonPad²
;* ControlSend,RichEdit20A1,^{End},ahk_class TalkpadClass
;*
;* ControlClick, Button1, DragonPad²
;*
;* ;-----------------------------------------------------
;* IfWinExist,Reload
;* Controlclick,Button1,Reload
;* Goto SingleCutNpaste
;*
;-----------------------------------------------------
Hkeys: ; Three hotkeys, preferably to use with a USB footpedal
;Gosub,Read_hokeys
Suspend,On
Gui, 2: Add, Hotkey, x45 y9 w80 h20 VHokey1
Gui, 2: Add, Hotkey, x45 y39 w80 h20 VHokey2
Gui, 2: Add, Hotkey, x45 y69 w80 h20 VHokey3
Gui, 2: Add, Hotkey, x45 y99 w80 h20 VHokey4
Gui, 2: Add, Hotkey, x45 y129 w80 h20 VHokey5
Gui, 2: Add, Hotkey, x45 y159 w80 h20 VHokey6
Gui, 2: Add, Hotkey, x45 y189 w80 h20 VHokey7
Gui, 2: Add, Hotkey, x45 y219 w80 h20 VHokey8
Gui, 2: Add, Hotkey, x45 y249 w80 h20 VHokey9
Gui, 2: Add, Text, x165 y9 w0 h0 , Text
Gui, 2: Add, Text, x145 y9 w170 h20 , Refresh and Focus to Dragonpad
Gui, 2: Add, Text, x145 y39 w170 h20 , Send to DragonPad²
Gui, 2: Add, Text, x145 y69 w170 h20 , Mic On/Off
Gui, 2: Add, Text, x145 y99 w170 h20 , Backup and Save
Gui, 2: Add, Text, x145 y129 w170 h20 , Big Cleanup
Gui, 2: Add, Text, x145 y159 w170 h20 , Delete time stamps
Gui, 2: Add, Text, x145 y189 w170 h20 , Timestamp -- Flag
Gui, 2: Add, Text, x145 y219 w170 h20 , Resend
Gui, 2: Add, Text, x145 y249 w170 h20 , Suspend Hotkeys
Gui, 2: Add, Button, x76 y280 w80 h30 , Submit
Gui, 2: Add, Button, x176 y280 w80 h30 , Escape
Gui, 2: Add, CheckBox, x16 y0 w10 h40 Vv1, VgumptionTog
Gui, 2: Add, CheckBox, x16 y30 w10 h40 Vv2, VSingleCnPTog
Gui, 2: Add, CheckBox, x16 y60 w10 h40 Vv3, VmicTogTog
Gui, 2: Add, CheckBox, x16 y90 w10 h40 Vv4, VfilesaveTog
Gui, 2: Add, CheckBox, x16 y120 w10 h40 Vv5, VbigcleanupTog
Gui, 2: Add, CheckBox, x16 y150 w10 h40 Vv6, Vdeletimestampstog
Gui, 2: Add, CheckBox, x16 y180 w10 h40 Vv7, VflagTog
Gui, 2: Add, CheckBox, x16 y210 w10 h40 Vv8, Vsave_dragonpadTog
Gui, 2: Add, CheckBox, x16 y240 w10 h40 Vv9, VSuspendTog
; Generated using SmartGUI Creator 4.0
Gui, 2: Show, x342 y244 h326 w337, Hotkeys
Return

2ButtonEscape:
Gui, 2: Destroy
Suspend,Off
Return

2ButtonSubmit:
IfExist, %A_ScriptDir%\DpadHkeys.txt
FileDelete, %A_ScriptDir%\DpadHkeys.txt
Gui, 2: Submit
Nomlist = gumption,singlecutnpaste,gosh,filesave,bigcleanup,deletimestamps,flag,Save_DragonPad,Suspend
Loop, Parse, Nomlist,CSV
{
ZoeyCount += 1
Zoey%ZoeyCount% = %A_LoopField%
;MsgBox, % Zoey%ZoeyCount%
}
Loop,9 ; This loop reads the hotkeys from the .ini file and writes them to a textfile?  Why use a textfile at all?
{
   Gorbak := hokey%A_Index%
   Grak := Zoey%A_Index%
IF Gorbak != ;
   {
   ;Hotkey, %Gorbak%, %Grak%
   FileAppend,%Gorbak% is %Grak%`n,%A_ScriptDir%\DpadHkeys.txt
   ;FileAppend, % "V%A_Index% is" V%A_Index%,%A_ScriptDir%\DpadHkeys.txt
   IniWrite,%Gorbak%,%A_ScriptDir%\Dpad.ini,S%A_Index%,ehk%A_Index%
   ;}
   If V%A_Index% = 1
      {
      Hotkey, %Gorbak%, %Grak%, On
      IniWrite, 1,  %A_ScriptDir%\Dpad.ini, S%A_Index%, V%A_Index%
      }
   Else
      {
      Hotkey, %Gorbak%, %Grak%, Off
      IniWrite, 0,  %A_ScriptDir%\Dpad.ini, S%A_Index%, V%A_Index%
      }
   
   }
Else, Continue
}
FileRead,sdf,%A_ScriptDir%\DpadHkeys.txt
MsgBox,,These are your hotkeys,%sdf%`nYou may change them at any time using the menu item hkeys
Gui, 2: Destroy
Suspend, Off
Return
;*
;*

Suspend:
Suspend
Return

;-----------------------------------------------------
^+#Backspace::  ;;Exit
GuiClose:
ExitApp
;-----------------------------------------------------
Panic:
Reload
Return
;-----------------------------------------------------
Pause::Pause
;-----------------------------------------------------
^+#d::  ;;Activate DragonPad²
IfWinNotActive,DragonPad²
WinActivate,DragonPad²
;-----------------------------------------------------
STOPTimedCutNpaste:
 ^numpad6::  ;Stop timed cutnpaste
stop = 1
Sleep,200
WinActivate,ahk_class TalkpadClass
Return
;-----------------------------------------------------
Timestamp:
FormatTime, nTime, %DateTimeStamp%, HH:mm:ss
FileAppend, `n[%nTime%]`n, %Mns%
Return
;-----------------------------------------------------
Flag:
FormatTime, nTime, %DateTimeStamp%, HH:mm:ss
FileAppend, -- [%nTime% //FLAG//] -- , %Mns%
Return
;-----------------------------------------------------
ButtonF12: ;;Turns mic on in Dragon
ControlClick,Button6,ahk_class DgnBarMainWindowCls
Return
;-----------------------------------------------------
SingleCutNpaste:
^numpad4::  ;;Init Single CutNPaste
ControlGetText,Lakshmi,RichEdit20A1,ahk_class TalkpadClass
StringLen,LakshmiLen,Lakshmi
Stringlen,SaraLen,Sarasvati
if %LakshmiLen% = %SaraLen%
Return
else
Ganesa := ( LakshmiLen - SaraLen ) ;Ganesa represents the number of new characters
; Here is where we put our vars for an erase feature

StringRight,Hanuman,Lakshmi,%Ganesa% ;Hanuman is those characters
StringReplace,Hanuman,Hanuman,%A_Space%%A_Space%,%A_Space%,All
StringReplace,Hanuman,Hanuman,%A_Space%.,.,All
StringReplace,Hanuman,Hanuman,%A_Space%?,?,All
FileAppend `n|%grier%| `t @%timez%@%ntime%@ -- %A_Space%%Hanuman%,%CurrentFiln% ; Appends Hanuman to logfile

Balaram := RegexReplace(Hanuman,"\s+"," ")
Loop,Parse,Balaram,%A_Space%, %A_Space%  ; parses based on A-Space as separator
{
AutoTrim,On
Kali = %A_Loopfield%
If Kali in %NoTimeList%
{
      IniRead,Mokie,%IniIni%,Texts,%Kali%
      Transform,Mokie,Deref,%Mokie%
      FileAppend, %Mokie%, %Mns%
}
Else
If Kali in %Commandlist%
{
      Grier++
      IniRead,Mokie,%IniIni%,Texts,%Kali%
      Transform,Mokie,Deref,%Mokie%
      FileAppend, %Mokie%, %Mns%
}
Else
FileAppend,%Kali%%A_Space%,%Mns%  ;This appends to the dictation textfile
Durga = %A_Index%
If A_Loopfield !=
++Wordcount
GuiControlGet, static1
If ( static1 <> Wordcount )
GuiControl,, static1, %Wordcount% words ; this avoids flicker
Sarasvati := Lakshmi
}
Gosub, FileRead
ControlSend,Edit1,^{End},DragonPad²
WinActivate,ahk_class TalkpadClass 
ControlSend,RichEdit20A1,`n`n,ahk_class TalkpadClass 
Return

;-----------------------------------------------------
TIMEDCUTNPASTE:
stop = 0
Winactivate, ahk_class TalkpadClass
SetKeyDelay, 1, 1
Loop
   {
   Winactivate,ahk_class TalkpadClass
   if stop = 1
   break
   else
   Lakshmi =
   Gosub,CutNPaste
   GuiControlGet, Static1
   If ( Static1 <> Wordcount ) ; Update the control only when needed
   GuiControl,, Static1, %Wordcount% words  ; this avoids flicker
   Sleep, 2000
   Sarasvati := Lakshmi
   Gosub, FileRead
   }
Return
;-----------------------------------------------------
CutNPaste:
Loop
   {   ;This loop just waits for input in the main edit
   if stop = 1
   break
   else
   ControlGetText,Lakshmi,RichEdit20A1,ahk_class TalkpadClass
   StringLen,LakshmiLen,Lakshmi
   Stringlen,SaraLen,Sarasvati
   if %LakshmiLen% = %SaraLen%
   Sleep, 250
   else
   break
}
Ganesa := ( LakshmiLen - SaraLen ) ;Ganesa represents the number of new characters
StringRight,Hanuman,Lakshmi,%Ganesa% ;Hanuman is those characters
Balaram := RegexReplace(Hanuman,"\s+"," ")
Loop,Parse,Balaram,%A_Space%, %A_Space%  ; parses based on A-Space as separator
   {
   AutoTrim,On
   If A_LoopField =
      Continue
   If A_LoopField Not in CapList
      ++Wordcount
   Kali = %A_Loopfield%
   If Kali in %NoTimeList%
      {
      IniRead,Mokie,%IniIni%,Texts,%Kali%
      Transform,Mokie,Deref,%Mokie%
      FileAppend, %Mokie%, %Mns%
      }
   Else
   If Kali in %Commandlist%
      {
      Grier++
      IniRead,Mokie,%IniIni%,Texts,%Kali%
      Transform,Mokie,Deref,%Mokie%
      FileAppend, [%Grier%] %Mokie%, %Mns%
      }
   Else
   FileAppend,%Kali%%A_Space%,%Mns% ;Appends word w/o change
   Durga = %A_Index%
   }

Winactivate,ahk_class TalkpadClass
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
Return

;-----------------------------------------------------
;These are utility hotkeys for use by footpedal
gumption: ;;Activate Npp, goto bottom, reactivate DragonPad
Gosub, FileRead
ControlSend,RichEdit20A1,^{end},ahk_class TalkpadClass
Gosub,FileRead
Winactivate,DragonPad²
ControlSend,Edit1,^{End},DragonPad²
WinActivate,ahk_class TalkpadClass
Return

gosh:
ControlClick,Button6,ahk_class DgnBarMainWindowCls
Return

;-----------------------------------------------------


;This is the stopwatch
StartStop:
 GuiControlGet, StartStop
 If ( StartStop = "Start" )
  {
     GuiControl,, StartStop, Stop
     SetTimer, Count,990
  }
 Else
  {
     GuiControl,, StartStop, Start
     SetTimer, Count, Off
     GuiControl,, PauseResume, Pause
     DateTimeStamp = 20061103000000
  }
Return

PauseResume:
 GuiControlGet, StartStop
 If ( StartStop = "Start" )
     Return
 GuiControlGet, PauseResume
 If ( PauseResume = "Pause" )
  {
     GuiControl,, PauseResume, Resume
     SetTimer, Count, OFF
  }
 Else
  {
     GuiControl,, PauseResume, Pause
     SetTimer, Count, 990
  }
Return

Reset:
  ;sGuiControl,, Static1, 00:00:00
  Gui,Show,NoActivate, DragonPad² -- 00:00:00 -- %Timez%
  DateTimeStamp = 20061103000000
Return

Count:
DateTimeStamp += 1, Seconds
FormatTime, nTime, %DateTimeStamp%, HH:mm:ss
If ( nDoze <> nTime )            ; Update the control only when needed
   {
   Gui,Show,NoActivate, DragonPad² -- %nTime% -- %Timez%
   }
nDoze := nTime
Return

update_clock:

FormatTime, timez,, HH:mm:ss
Return

; The updateclock function is courtesy of SKAN
;-----------------------------------------------------

Scrolllock:: ;;Winactivates DragonPad
WinActivate, ahk_class Notepad++
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,d,ahk_class DgnBarMainWindowCls
WinActivate, ahk_class TalkpadClass
Return

;-----------------------------------------------------

ButtonSpell:
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,s,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²
WinActivate, ahk_class TalkpadClass

Return

ButtonNum:
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,u,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²
WinActivate, ahk_class TalkpadClass

Return

ButtonDict:
ControlClick,Button3,ahk_class DgnBarMainWindowCls
ControlSend,,d,ahk_class DgnBarMainWindowCls
WinActivate, DragonPad²
ControlClick,Edit1,DragonPad²
ControlSend,Edit1,^{End},DragonPad²
WinActivate, ahk_class TalkpadClass

Return

PigBodine: ;This places all the windows for my workspace
^+#p::
WinGetPos,Zipi,Ditzah,Benny,Pig,DragonBar
Sysget, Greg, MonitorWorkArea,1
Beer := GregBottom
EnvDiv,Beer,2.5
WinMove,ahk_class TalkpadClass,,0,%GregTop%,%GregRight%,%Beer%
WinActivate,ahk_class TalkpadClass
WinActivate,DragonPad²
Douche := (Beer + GregTop)
WinMove,DragonPad² ,,0,%Douche%,%GregRight%,( GregBottom - Douche )
Return

;-----------------------------------------------------

#^!+Delete:: ;; Clear All from Dragonpad
   WinMenuSelectItem, ahk_class TalkpadClass,,Edit,Select All
   WinMenuSelectItem, ahk_class TalkpadClass,,Edit,Clear
Return

^+#r::
Buck++
If Buck > 1
Buck =

      If Buck = 1
      WinSet, Transparent, 100, DragonPad²

      If Buck =
      WinSet, TransColor, Off, DragonPad²

Return


Grit:
ControlSetText,Edit1,,DragonPad²
FileRead:
FileRead, MainEdit, %Mns%  ; Read the file's contents into the variable.
if ErrorLevel
{
    MsgBox Could not open "%Mns%".
    return
}
Gui, 1: Default
GuiControl,, MainEdit, %MainEdit%  ; Put the text into the control.
CurrentFileName = %Mns%
Gui, Show,, DragonPad²    ; Show file name in title bar.
ControlSend,Edit1,^{End},DragonPad²
return



OpenWith:
If MyEdit =
FileSelectFile,Chesty,3,%A_ProgramFiles%,Select your preferred text editor,*.exe
Run "%Chesty%" "%Mns%"
Return




ReSend:
MsgBox, This will back up all of your work to %Mns%-BU.txt and start resend everything.  To proceed, select OK
FileMove,%Mns%,%Mns%-BU.txt,1
ControlSetText,Edit1,,DragonPad²
Sleep,300
FileDelete,%Mns%
Wordcount =
Sarasvati =
Gosub, SingleCutNpaste
Return

ViewCommands:
Loop,2
{
If A_Index = 1
IniRead,Hammer,%IniIni%,Commands,Commandlist,ZugZug ;This is where we get the commandlost
Else
IniRead,Hammer,%IniIni%,NoTimes,NoTimeList,ZugZug
If Hammer = Zugzug
   {
   MsgBox,Wrong file apparently
   Exitapp
   }
Else
If A_Index = 1
      {
      IfExist,%IniIni%-temp.htm
      FileDelete,%IniIni%-temp.htm
      FileAppend,<DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">`n<HTML>`n<HEAD>`n<TITLE>%IniIni%-temp.htm</TITLE>`n<META NAME="Generator" CONTENT="TextPad 4.0">`n<META NAME="Author" CONTENT="?">`n<META NAME="Keywords" CONTENT="?">`n<META NAME="Description" CONTENT="?">`n<style type="text/css">`n.larger {font-size:150`%;font-weight:normal;color:blue;}`n.tabby   {background-color: #EAE7DA; color: brown; }`n</Style>`n</HEAD>`n`n<BODY bgcolor="FFFFFF" text="000000" link="0033CC" vlink="660066" alink="00CC33">,%IniIni%-temp.htm
      FileAppend,<p><center><Span class="Larger">This is a simplified view of your DragonPad² commandlist <a href="file:///%IniIni%">%IniIni%.</a></Span></center></p>,%IniIni%-temp.htm 
      FileAppend,<table border="1" cellspacing="0" cellpadding="5" width="100`%">`n<tr>`n<td width="25`%" bgcolor="#000099" height="16"><span style="color:#FFFFFF;"><strong>Command</strong></span></td>`n<td width="75`%" bgcolor="#000099" height="16"><span style="color:#FFFFFF;"><strong>Description</strong></span></td>`n</tr>,%IniIni%-temp.htm
      }
Loop,Parse,Hammer,CSV ;This is where we parse the commandlist CSV style
   {
   Smack = %A_LoopField%
   IniRead,Durs,%IniIni%,Texts,%A_LoopField%,ZugZug
   If Durs = ZugZug
      Continue
   Else
         StringReplace,Durs,Durs,``n,<Span class="tabby">(CR)</Span>`<br`>,All
         StringReplace,Durs,Durs,`%A_Space`%,<Span class="tabby">`&nbsp`;</Span>,All
         StringReplace,Durs,Durs,`%ntime`%,<span style="color:Green;">Time (HH:mm:ss)</Span>,All
         StringReplace,Durs,Durs,`%A_Tab`%,<Span class="tabby">(Tab)</Span>,All
         StringReplace,Durs,Durs,`%Timez`%,<span style="color:Purple;">Timer (HH:mm:ss)</Span>
         FileAppend,<tr><td height="16" class="larger">%Smack%</td><td>%Durs%</td></tr>,%IniIni%-temp.htm
   }
   }
   FileAppend,</Table>`n<br>DragonPad² is a free`, open-source project aimed at enhancing the functionality of Dragon Naturally Speaking`, particularly for the purposes of legal transcription.  It is written with the free`, open-source scripting language <A Href="http://autohotkey.com">AutoHotkey.</a> </Body>,%IniIni%-temp.htm
   Run,%IniIni%-temp.htm
   Return

;^s::
   
FileSave:
SaveCurrentFile:  ; Caller has ensured that CurrentFileName is not blank.
ControlGetText,Simone,Edit1,DragonPad²   ; Retrieve the contents of the Edit control.
If Simone =
{
MsgBox,Fail`, Try Again
Return
}
IfExist %Mns%
{
    FileMove, %Mns%,%Mns%.BAK
    FileDelete, %Mns%
}

FileAppend, %Simone%, %Mns%  ; Save the contents to the file.
Gosub, Fileread
return

;-----------------------------------------------------
^+#c::
CleanupCommands:  ;;Toggle cleanup command view
IfWinExist,DD-Cleanup ;This toggles the window to front or back
      {
      If Chips <> 1
         {
         WinSet,AlwaysOnTop,On,DD-Cleanup
         WinRestore,DD-Cleanup
         Chips = 1
         }
      Else
         {
         Winset,AlwaysOnTop,Off,DD-Cleanup
         WinMinimize,DD-Cleanup
         Chips = 0
         }
      Return
      }
   Else
   
AutoTrim,off
Gui, 3: Add, ListView, xm r10 w100 GMyListView Grid VMyListView, Name ; r20 w150 w200
  Gui, 3:Default
  Gui, 3: +LastFound
  Loop,Read,%A_ScriptFullPath%
{
    Line=%A_LoopReadLine%
   StringReplace,Line,Line,`;`;`;,Ã,All
   IfInString, Line,Ã
   {
   IfinString, Line, `:
   {
   StringSplit,Gnurr,Line,`:
         LV_Add("",Gnurr1)
      LV_ModifyCol()  ; Auto-size each column to fit its contents.
      LV_ModifyCol(3, 60) ; Make the Size column at little wider to reveal its header.
   }
   Else, Continue
   }
   Else, Continue
}
   ; performs alphabetical sort:
   LV_ModifyCol(1, "Sort", Name)
   Gui, 3: +Resize
   Gui, 3: Show,,DD-Cleanup
return

3GuiClose:
Gui, Destroy

3GuiSize:  ; Expand or shrink the ListView in response to the user's resizing of the window.
if A_EventInfo = 1  ; The window has been minimized.  No action needed.
    return
; Otherwise, the window has been resized or maximized. Resize the ListView to match.
GuiControl, Move, MyListView, % "W" . (A_GuiWidth - 20) . " H" . (A_GuiHeight - 20) ;%
return

MyListView:
if A_GuiEvent = DoubleClick
LV_GetText(RowText1, A_EventInfo,1)
Gosub %RowText1%
Gui, 3: Destroy
Return

;-----------------------------------------------------

BigCleanup: ;;;This is a command that performs some common corrections such as in this case removing any spaces before periods or question marks from the file in npp.  You can add any others. 
^+#!g:: 
;FileRead,Nuzzle,%Mns%
IfExist, %Mns%Temp.txt
FileDelete, %Mns%Temp.txt
Loop, Read, %Mns%, %Mns%Temp.txt
{
;If A_LoopReadLine =
;Continue
;Else
Nuzzle := RegExReplace(A_LoopReadLine,"^\s+$","") ; reaplace lines with only whitespace w/ blank lines
StringReplace,Nuzzle,Nuzzle,_.,%A_Space%%A_Space%,All ;Replaces the "_." with a two spaces
Loop {
StringReplace,Nuzzle,Nuzzle,%A_Space%?,?,All ;Eliminates spaces before question marks
If Errorlevel
Break
}
Loop {
StringReplace,Nuzzle,Nuzzle,%A_Space%.,.,All ;Eliminates spaces before periods
If Errorlevel
Break
}
Loop {
StringReplace,Nuzzle,Nuzzle,%A_Space%`r`n,`r`n,All ;Eliminates spaces at end of lines
If Errorlevel
Break
}
Loop {
StringReplace,Nuzzle,Nuzzle,%A_Tab%,%A_Space%%A_Space%%A_Space%%A_Space%,All
;StringReplace,Nuzzle,Nuzzle,`r`n,,All ;Eliminates blank lines, one hopes
If Errorlevel
Break
}
Drainblo := RegExReplace(Nuzzle,"^(\s+)?[QA\?\.]?[-+\?\.]?\s+$","") ;lkg
If Drainblo =
Continue ;pass over blank lines
FileAppend,%Drainblo%`n
}
FileMove, %Mns%Temp.txt, %Mns%, 1
ControlSetText,Edit1,,DragonPad²
Sleep, 50
Gosub, Grit
ControlSend,RichEdit20A1,^{End},ahk_class TalkpadClass
WinActivate,ahk_class TalkpadClass
Return


DeleTimeStamps:  ;;;This deletes all timestamps
FileRead,Nuzzle, %Mns%
Mutter := RegExReplace(Nuzzle,"\[.*?\]","")
FileDelete,%Mns%
FileAppend,%Mutter%,%Mns%
Gosub,Grit
Return

SendToWP: ;;; Send Mns to WP one key at a time
IfWinExist,ahk_class WordPerfect.12.00
{
WinActivate,ahk_class WordPerfect.12.00
ControlSend,WPDocClient1,^{End},WordPerfect
Sleep,100
FileRead,Nuzzle,*t %Mns%
ControlSend,WPDocClient1,%Nuzzle%,WordPerfect
}
Return

Save_DragonPad: ;;;Save in Dragonpad
WinMenuSelectItem,ahk_class TalkpadClass
,,File,Save
Sleep,100
IfWinExist,Save As
ControlSetText,Edit1,%Mns%.rtf,Save As
Sleep,50
ControlClick,Button2,Save As,,,,2
Return

;-----------------------------------------------------




And here is how that command list looks when formatted as HTML, for browsing purposes:

http://homeofthegnome.net/AHK/comlist-2.ini-temp.htm

And it links directly to the ini file, which you can view or copy for your own use.

Anybody want to improve the code or optimize it, pls. do so and share your results. I am still calling this an open-source project and anybody may add to it, but are forbidden from selling it for money.

;-----------------------------------------------------

The fiendish plot certainly isn't about encouraging people to adopt freeware and shareware as a new model of computer use, instead of nickel-and-diming each other to death.


Last edited by ribbet.1 on October 15th, 2009, 6:54 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 15th, 2009, 6:18 am 
Offline

Joined: July 1st, 2009, 9:13 pm
Posts: 16
Wow, amazing stuff! Thank you for all the work, this is great. ^_^

<waves cheerfully>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 15th, 2009, 6:47 am 
Offline

Joined: February 20th, 2007, 1:37 pm
Posts: 198
Location: D.C.
Thanks! IvoLucien, if you try this, I would appreciate any input or fback. You can PM me also.

If you save the above script and then download the above http://homeofthegnome.net/AHK/comlist-2.ini or whatever and save it to the same dir, you can just try that as a prefab comlist. Come up with your own comlist at your convenience.

And a couple other minor notes:

I originally had the 3 most important functions mappable as hotkeys but extended it to 9. But the first 3 are the most important. I originally set it up so you can use a transcriber's "infinity" foot pedal (3-button) in conjunction with NCH Software's free application, "Pedable" to control any, but most especially the "cut-n-paste," the refresh and mic on/off functions using your foot ideally. A USB numpad seems like a great idea also. The default bindings are Ctrl-(numpad number 1-9). But we're very footpedal-friendly here.

And finally, a very important function is the "resend" menu item. What you do is you transcribe everything, and when finished you make all your corrections in the Dragonpad rather than DragonPad², and then resend, which backs up the text in DragonPad², deletes it all, and sends it again with any corrections. Point being that you hopefully provide Dragon some more training that way.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 10 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group