Using AutoHotkey to Send Gmail Messages from Dentrix

Electronic messaging has become the preferred method of reminders by many practices and patients alike. Recently I posted about how to make Dentrix send text messages, however some prefer to send an email instead.

There are many companies offering text and email messaging services to dental office, but most are expensive and achieve the same results we can get for free using AutoHotkey and Gmail with Dentrix. If you aren’t a Gmail user, then you can use a text editor, like Notepad, to easily substitute your own keystrokes into the appropriate section of the script.

AutoHotkey is a scripting application for Windows that allows one to reproduce a stream of keystrokes easily. In order for it to work with Dentrix in Windows 7, specifically, it must be run in XP mode:

  • Install AutoHotkey (use the Instaler for AutoHotkey_L option)
  • Open Windows Explorer (Win-E)
  • Navigate to C:\Program Files\AutoHotkey\
  • Right-click on AutoHotkey.exe, and select Properties
  • Click on the Compatibility tab
  • Select the checkbox for “Run the program in compatibility mode for:”
  • Select Windows XP (Service Pack 3) in the dropdown box
  • Select “OK”, and close Windows Explorer.

Here is how we handle emailing with Dentrix in our office:

  • Install AutoHotkey
  • Copy the script at the end of the article to Notepad, and save the document as “emailing_recall.ahk” on the Desktop.
  • Double-click on the script on the desktop to load it into memory
  • Open Gmail and login to your account
  • Open Dentrix Appointment Book
  • For those using Dentrix G4 with Productivity Pack 7 or higher, hover over the target appointment and verify the presence of an email address. For those not on PP7 yet, hit Ctrl-F. This will activate a part of the script that will show the Family File for that patient for 2 seconds.
  • OPEN THE APPOINMENT CARD (double click on the appointment), and click Ctrl-Win-E. What you will observe is the script copying the date and time, opening the Family File, copying the email address, opening Gmail, and pasting in the information.
  • Once you are sure that the text is filled in correctly, manually hit “Send” and return to the Appointment Book by hitting Alt-Tab.

The script sends a  message such as: “We look forward to seeing you at Dr. McCall’s office on 01/11/2011 at 2:00pm. Please reply with "CONFIRM" in the subject to confirm.”

Patients that get the message can spend a few seconds sending a simple “CONFIRM” message to confirm the appointment. Once the confirmation email is received, the front desk administrator can then manually change the appointment’s status to “FIRM” in Dentrix Appointment Book.

The script may need to be fine tuned for the particular computer using it. You may notice that there are “sleep” commands throughout the script. These are delays required to let Dentrix ready itself for the next command. It is possible that slower computers will require more delay time in order, and you may need to use trial and error to find the correct delay times.

This script works for confirming appointments for appointments coming soon. We can use this method, however, for sending emails for other purposes. That will be the topic of another article.

Here is the script. You can paste it into a new txt file, but make sure that you remove any of the word wraps that incurred from the posting of it to this blog post:

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function:
;    Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#^e::
; scrapes data from Dentrix appt and FF and pastes it into GMail
;
; Begin with APPOINTMENT CARD (in Appt Bk) and Firefox or Internet Explorer (with Gmail logged in) open
; From Appt card, hit Ctrl-Win-e
; If you don’t use Gmail, then edit the section after LAUNCH GMAIL to open your email program and paste in the variables appropriately
;
; SCRAPE DATA FROM APPOINTMENT CARD
send !d
send ^C
ClipSaved_1 = %Clipboard%  ;GRAB APPT DATE
sleep 500
Send !t
Send ^c
ClipSaved_2 = %Clipboard%  ;GRAB APPT TIME
sleep 500
; OPEN FAMILY FILE AND SCRAPE EMAIL ADDRESS
send !p
WinWait, Dentrix Family File
SetControlDelay -1
ControlClick, PFPersonal1, Dentrix Family File
sleep 200
send {ENTER}
sleep 200
WinWait, Patient Information
sleep 200
Send !a
sleep 200
send {TAB 5}
send ^c
ClipSaved_3 = %Clipboard%  ; GRAB EMAIL ADDRESS
sleep 500
send !{F4}
sleep 500
send !{F4}
sleep 500
; LAUNCH GMAIL
run https://mail.google.com/mail/#compose
sleep 500
WinWait, Gmail – Compose Mail
sleep 500
send %ClipSaved_3%
sleep 500
send {ENTER}
sleep 1000
send {TAB}
sleep 500
send CONFIRMATION email from Dr. McCall’s Office
send {TAB}
sleep 500
; CHANGE THE FOLLOWING LINE TO REFLECT THE DESIRED MESSAGE.
send We look forward to seeing you at Dr. McCall’s office on %ClipSaved_1% at %ClipSaved_2%. Please reply with "CONFIRM" in the subject to confirm.
send {ENTER}
return

^f::
; opens the Family File to verify presence of an email address
send !f
sleep 800
send f
sleep 800
send {ENTER}
sleep 2500
send +{tab}
sleep 500
send {ENTER}
sleep 500
send !{f4}
return

5 Responses to “Using AutoHotkey to Send Gmail Messages from Dentrix”

  1. Hi Dana

    I am glad I ran across your website…. I like the script for the hotkey and appointments reminders by gmail.

    I have a question,,, How can we automate the process for all the patients that day…. IE tab forward int he appointment book to auto fill in the info..

    Thank You,

    Tom

  2. I can’t find a way to navigate the Appt Book or the Appt List with arrows. I SUPPOSE you could make a script that opens Patient Reports (by filters) and export to excel, necessary data for people with appts in a certain range. Then from the temporary excel spreadsheet, run through and create reminders from that list.

    In our office we don’t have everyone’s email address, so that’s why we have to be selective.

  3. Dana,

    LOVE the Dentrix tips, please keep posting them! Our office is using them and finds them fabulous.

    Thank you,
    Michael

  4. Thanks so much for the feedback! I certainly will have some more coming in a few weeks. I’m off to the Hinman, and am implementing iPads for paperless charting….

  5. With hotkeys on, in gmail, you can navigate up and down the inbox with j and k.