KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Savings DATS
Topic Summary: methods to save dATS
Created On: 01/11/2021 09:46 AM
Status: Post and Reply
Linear : Threading : Single : Branch
 Savings DATS   - Charlie - 01/11/2021 09:46 AM  
 Savings DATS   - Alan Cantor - 01/11/2021 02:28 PM  
 Savings DATS   - Charlie - 01/11/2021 03:39 PM  
 Savings DATS   - Alan Cantor - 01/11/2021 04:52 PM  
 Savings DATS   - Charlie - 01/11/2021 05:19 PM  
 Savings DATS   - Alan Cantor - 01/11/2021 10:01 PM  
 Savings DATS   - Alan Cantor - 01/12/2021 11:50 AM  
Keyword
 01/11/2021 09:46 AM
User is offline View Users Profile Print this message

Author Icon
Charlie
Senior Member

Posts: 113
Joined: 09/14/2014

Has anyone come up with a macro or method to save dats other then selecting them in each directory and saving?

 

 

 

 01/11/2021 02:28 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3989
Joined: 12/08/2007

What does "DATS" mean?
 01/11/2021 03:39 PM
User is offline View Users Profile Print this message

Author Icon
Charlie
Senior Member

Posts: 113
Joined: 09/14/2014

sorry dragon commands saved as dat files.

 

There are a few old posts on forum mentioning some macros to automate saving commands but they dont seem to work, but posts are old.

 

 01/11/2021 04:52 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3989
Joined: 12/08/2007

The old commands are probably still valid. Consider posting one of the commands here so we can get a better idea of what you have in mind.
 01/11/2021 05:19 PM
User is offline View Users Profile Print this message

Author Icon
Charlie
Senior Member

Posts: 113
Joined: 09/14/2014

KnowBrainer Speech Recognition Forums - What's the best way to backup my Dragon Commands without backing up my entire user profile?

 

Alternatively, only if you want to export all your commands (.dat format only) you can use the following cool script created by Lindsay Adam. It's a huge timesaver!

I named it: 



Export Now

 

Sub Main

Dim eng As New DgnEngineControl

commandsFileLocation = eng.SpeakerDirectory & eng.Speaker & "\Current\MyCmds.dat"

newCommandsFile = " " & Format (Now, "mm-dd-yyyy") & ".dat"

FileCopy commandsFileLocation, "E:\Dragon Commands\" + newCommandsFile

End Sub

 

E:\Dragon Commands is my file save location. You can replace it with your own path.

The produced file (only takes a second) will be named the current date i.e 09-17-2020

 

 

 

 

 

Option Explicit
Sub Main
Dim fso, commandsFileLocation, newCommandsFile
Dim eng As New DgnEngineControl
 
Set fso = CreateObject("Scripting.FileSystemObject")
    If fso.FolderExists("H:\Documents\Dragon\") Then
        commandsFileLocation = eng.SpeakerDirectory & eng.Speaker & "\Current\MyCmds.dat"
        newCommandsFile = "My Commands Backup " & Format (Now, "dd-mm-yyyy") & ".dat"
        FileCopy commandsFileLocation, "H:\Documents\Dragon\" + newCommandsFile
        'Messagebox courtesy of pgInfoBox (C) 2013 PG Service
        pgInfoBox("Your commands are backed up.",1) ' if num = 0, no auto-dismiss
    Else
        fso.CreateFolder("H:\Documents\Dragon\")
        commandsFileLocation = eng.SpeakerDirectory & eng.Speaker & "\Current\MyCmds.dat"
        newCommandsFile = "My Commands Backup " & Format (Now, "dd-mm-yyyy") & ".dat"
        FileCopy commandsFileLocation, "H:\Documents\Dragon\" + newCommandsFile
        pgInfoBox("The folder has been created and your commands backed up",1) ' if num = 0, no auto-dismiss
 
    End If
End Sub
Function pgInfoBox(dispText As String, dispTime As Integer)
     ' An auto-dismissing MsgBox (courtesy of MS Windows Scripting Host)
     ' Reference: Popup Method at http://msdn.microsoft.com/en-us/library/x83z1d9f(v=vs.84).aspx
     Dim ib
     Set ib = CreateObject("WScript.Shell")
     pgInfoBox = ib.Popup(dispText & vbCrLf & " " & vbCrLf _
          & "Click OK (or just wait . . .)", 4, _
          "Dragon Commands Backup Message", 0)
     Set ib = Nothing
End Function

 

 01/11/2021 10:01 PM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3989
Joined: 12/08/2007

What isn't working? Both examples look OK to me.
 01/12/2021 11:50 AM
User is offline View Users Profile Print this message


Alan Cantor
Top-Tier Member

Posts: 3989
Joined: 12/08/2007

I just tried Lindsay's first example, and it worked. Here's how to do it:

1. Open the Command Browser.
2. Click on "Script" mode.
3. Click "New"
4. In the "MyCommand" field, type "Export Now" (or another unique name that's easy to say and easy to remember)
5. In the "Command Type" drop down, choose "Advanced Scripting"
6. In the "Script" box, delete everything.
7. Paste the following into the Script box. (Note: I made a minor change to Lindsay's script.)


Sub Main
Dim eng As New DgnEngineControl
commandsFileLocation = eng.SpeakerDirectory & eng.Speaker & "\Current\MyCmds.dat"
newCommandsFile = " " & Format (Now, "mm-dd-yyyy-hh-mm-ss") & ".dat"
FileCopy commandsFileLocation, "E:\Dragon Commands\" + newCommandsFile
End Sub

8. Edit this part of the script:

"E:\Dragon Commands\"

You must change it to the folder where you want your backup files to go. For example:

"C:\Users\Charlie\Dragon Backups\"

Make sure that the backup folder exists.

9. Click "Save"

10. Test your command by saying the command you typed in Step 4.

11. Go to the folder to check that the file has been created.



KnowBrainer Speech Recognition » Commands, Scripts, and Macros - Dragon » Savings DATS

Statistics
31938 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 3 users logged in.
The most users ever online was 12124 on 09/09/2020 at 04:59 AM.
There are currently 417 guests browsing this forum, which makes a total of 420 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2021 FuseTalk™ Inc. All rights reserved.