Adding Some Dates with Dragon NaturallySpeaking

You can have Dragon into the current date into a document in a variety of formats by creating some scripts.

I like to use a date in this form: yyyymmdd to put in email subject lines or at the beginning of file names. For example, I initially wrote this blog post on 20160916.

I called my command “isodate” and here’s the script (command type is Advanced Scripting).

You can have Dragon into the current date into a document in a variety of formats by creating some scripts.

I like to use a date in this form: yyyymmdd to put in email subject lines or at the beginning of file names. For example, I initially wrote this blog post on 20160916.

I called my command “isodate” and here’s the script (command type is Advanced Scripting).

Sub Main
	n=Now()
	d = DateValue(n)
	s=Format(d,"yyyymmdd")
	SendDragonKeys s
End Sub

Here is a command to send a long date format, which I’ve attached to my Dragon command called “long date”. I wrote this blog post on September 16,2016.

Sub Main
	n=Now()
	d = DateValue(n)
	s=Format(d,"mmmm dd,yyyy")
	SendDragonKeys s
End Sub

The script is very easy to modify, and you can look up the Visual Basic reference material for the format command if you wish a different date format.
Here is a command to send a long date format, which I’ve attached to my Dragon command called “long date”. I wrote this blog post on September 16,2016.

The script is very easy to modify, and you can look up the Visual Basic reference material for the format command if you wish a different date format.

Making a Call with Dragon NaturallySpeaking

I frequently dial my phone client using Dragon NaturallySpeaking. Most phone clients on Windows will respond to a tel: URI scheme.  Clicking on a tel: link will dial the phone, For example, clicking on a tel:2505551212 and was computer systems will launch whatever program is registered to dial the phone number.

The phone client I have been using recently is Bria.  It is not very pleasant to try and dial the phone with Dragon NaturallySpeaking and Bria together. (If you find a way to clear the phone number by voice in Bria please leave a note with instructions in the comments).

Below is a script in Dragon NaturallySpeaking to pop up a dialogue to enter a phone number, and then to use the default dialer to make the call. I called my command “make a call”, the command type of Advanced Scripting. The script was copied from a sample built-in to Dragon NaturallySpeaking version 15 professional.

' This script displays a user dialog in which the
' user types or dictates a name.

' It then displays whatever the user typed in a
' message box.

Sub Main
	Begin Dialog UserDialog 400,98,"Sample User Dialog",.DialogFunc ' %GRID:10,7,1,1
		Text 20,14,220,14,"Please enter the phone number:",.Text1
		TextBox 20,35,370,21,.TextBox1
		OKButton 70,63,90,21
		CancelButton 220,63,90,21
	End Dialog
	Dim dlg As UserDialog
	result = Dialog (dlg)

	If result = -1 Then ' If the user clicked OK,
		SetMicrophone 0
		ShellExecute("tel:"+dlg.TextBox1)
	End If
End Sub
Function DialogFunc%(DlgItem$, Action%, SuppValue%)

	Select Case Action%
		Case 5
		DlgFocus("TextBox1")
	End Select

End Function

If you would like to call a specific phone number, create a command with a name like “call home” and create a command type of “step-by-step”. The new step will be Open (application). The target will be “tel: 250.555.1212”, of course replacing the phone number with whatever number you would like to dial.

The format of your phone number must be compatible with whatever form dialer you’re using.

I also created a command “answer the phone” that sends the keystrokes Bria requires to answer the phone, then turns the microphone off.