MarkSchlegel.com

18. April 2013 22:42
by Mark Schlegel
0 Comments

Using Auto Hotkey to Automate Quicken to Export a QIF File

18. April 2013 22:42 by Mark Schlegel | 0 Comments

I plan on switching away from Quicken, but not immediately.  I need to use whatever my new tool is along side Quicken for quite awhile before I will feel comfortable dropping Quicken.  It has so much of my financial history and I want to take as much of it with me as possible.  To do so, I plan on developing something that will import the .QIF that Quicken provides as the main export format.  I will continue to do data entry into Quicken until I feel comfortable.  So not to do duplicate data entry, I decided to automate the steps necessary to export the .QIF file.   

Quicken Export Screenshot

Auto Hotkey was my tool of choice.  If you've never used Auto Hotkey, it's a scripting tool that allows you to automate various things you do in Windows.  Best of all, the scripts you create can easily be converted into an executable file (.exe).  I basically call the Hotkeys provided by Quicken and send tabs a few times, as well as the path where I want the export to go.  I've attached the script if you want it, or just copy and paste the following code.  The script takes two parameters - any part of the title of the Quicken window and the name of the QIF File to Export to. 

;--------------------------------------------------------------------------
;Export Quicken Data to QIF
;--------------------------------------------------------------------------
 
 
if 0 < 2  ; The left side of a non-expression if-statement is always the name of a variable.  

;%0% contains the number of command line parameters received
{
    MsgBox This script requires a parameter for the name of the Quicken window (e.g. Quicken 2013 Home & Business) and the name of the QIF File to Export to.

    ExitApp
}
 
IfWinExist, %1%;Quicken 2013 Home & Business
    WinActivate ;Bring the Quicken Window to the front
else
    ExitApp
 
 
 
Send !f; Ctrl+F
WinWait, PopupWindowTitle,, 3   ; Wait up to 3 seconds for the window to appear.
Send e
WinWait, PopupWindowTitle,, 3; Wait up to 3 seconds for the window to appear.
Send {enter}
 
Sleep 2000
 
Send %2% ; Send the second parameter provided as the name of the QIF file to Export to
 
Send {tab}
Sleep 300
Send {tab}
Sleep 300
Send {tab}
Sleep 300
Send {tab}
Sleep 300
Send {tab}
Sleep 300
 
;  Ideally I would like to check the various "Include in Export" checkboxes.
;  Transactions, Account List, Category List, etc.
;  I'm not investing the time now because the current version of Quicken saves
;  preferences of which boxes were last checked.
;  so instead we're just tabbing past them.
 
Send {tab}
Sleep 300
Send {tab}
Sleep 300
Send {tab}
Sleep 300
Send {tab}
Sleep 300
Send {tab}
Sleep 300
Send {tab}
Sleep 300
 
Send {enter}
 
WinWait, PopupWindowTitle,, 3
Send {enter}

AutoHotkey.ahk (2.93 kb)

blog comments powered by Disqus