Skip to content
Import Prices Script for Quicken 2006
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ChangeLog
LICENSE
QImportP.cmd.txt
QImportP.wsf
README

README

===========================================================================
QImportP

    On the Web:
        http://www.aczoom.com/tech/import-prices-script-for-quicken/
    Source Code:
        https://github.com/avinash311/QImportP/

This Windows JScript program:
    1) Extracts current price quotes from a CSV file on the web such as a
       Google Spreadsheet and/or the AlphaVantage.co web interface.
    If /automate is specified as an argument:
    2) starts Quicken (if not already started - but this is not reliable)
    3) sends keys to import the prices using Quicken's Import Prices command.
      If Quicken file is protected with Password, the automation will not work
      unless Quicken is started and the password entered before running
      this script.

    Downloaded prices are stored in file QImportP.csv, in the directory
    %TMP% or %TEMP%, or C:\WINDOWS\TEMP, whichever setting is found first.


Usage: QImportP.wsf [/automate] [/gcsv:google-spreadsheet-download-url]
                    [/v:verbose-level] [/dmy:date-format] [/symonly] [/help]
                    Google Spreadsheet has stale price data for mutual funds.
                    Maybe 4 days old in many cases.

                    Using AlphaVantage.co gets more current prices:
                    /avkey:your-key /s:symbols [/days:number-of-days] [/div:divide-by]

Options:

automate   : Import prices into Quicken. If necessary, tries starting Quicken.
gcsv       : Google Spreadsheet download-as-CSV URL
             /gcsv: option does not use the /s or /div or /days option shown below.
             It downloads all ticker symbols stored at the URL.

dmy        : Output date format. Characters DMY are replaced with date values 
             (Default M/D/Y will convert 1st Aug 2017 to 08/01/2017)
             (further examples /dmy:D/M/Y will give 01/08/2017 and /dmy:Y-M-D will give 2017-08-01) 
symonly    : Ignore the exchange part of symbol in output (eg. Output LON:LLOY as LLOY)
             (The symbol in the QImportP output must match the value defined in Quicken
              - eg. if you have LON:LLOY in the file, edit the value in Quicken
                    using /symonly, ensure only the value LLOY is specified in Quicken)

avkey      : Your personal AlphaVantage key. See their doc: https://www.alphavantage.co/
s          : List of comma-separated symbols for pricing (symbols in alphavantage.co format)
             Note: prefix symbol with "!" to ignore /div setting for that symbol
days       : Number of days history to retrieve (default = 0, latest price only)
             Note that only /avkey and /s API supports historical quotes, /gcsv does not.
div        : Divide amounts by value, for converting pence into pounds, or any other division
             if the symbol is prefixed by "!", the /div conversion will be ignored for that symbol

help       : /? or /h or /help - Print usage description

   Example: cscript QImportP.wsf /gcsv:"https://docs.google.com/spreadsheets/d/1yzIpQRdfJh5hm5y9tF7LW060eLH8rkXr7PW4SFwkLlY/export?format=csv" /symonly /automate

   Example spreadsheet:
     https://docs.google.com/spreadsheets/d/1yzIpQRdfJh5hm5y9tF7LW060eLH8rkXr7PW4SFwkLlY/edit?usp=sharing
     Make a copy of that spreadsheet, make it shared, allow "Anyone to view with a link", and then
     change the URL in this manner to get the download URL:
     Change the final /edit?... to /export?format=csv as shown below for the example spreadsheet:
     https://docs.google.com/spreadsheets/d/1yzIpQRdfJh5hm5y9tF7LW060eLH8rkXr7PW4SFwkLlY/export?format=csv"

    The following examples require using AlphaVantage: https://www.alphavantage.co/ and
    using this argument in all the calls below:
       /avkey:your-personal-alphavangtage.co-key

    cscript QImportP.wsf ... /s:"CSCO,GE,FMAGX,VFINX" /noget
       Will do nothing.

    cscript QImportP.wsf ... /s:"CSCO,GE,FMAGX,VFINX" /noget /automate
       Will not get any prices, but will use existing QImportP.csv
       file, and start up quicken, and use Windows SendKeys automation
       to import that file into the Quicken Portfolio View.

    cscript QImportP.wsf ... /s:"CSCO,GE,FMAGX,VFINX" /automate
       Will get prices for above list, latest prices only.
       Downloaded prices are stored in QImportP.csv
       Will start up quicken, and use Windows SendKeys automation
       to import that file into the Quicken Portfolio View.
	   
	cscript QImportP.wsf /s:"CSCO,GE,!FMAGX,VFINX" /automate /days:7 /dateformat:D-M-Y /div:100
       Will get prices for above list, with 7 days history.
       Downloaded prices are stored in QImportP.csv where the prices will show as price/100 except for FMAGX which will have no division
	     and the date format will show as dd-mm-yyy
       Will start up quicken, and use Windows SendKeys automation
       to import that file into the Quicken Portfolio View.
	   
    This program has to be run in a Windows Console terminal,
    or a short-cut can be manually created to run with required arguments.

  QImportP.cmd.txt :
    Edit this example script to call QImportP.wsf with the list of symbols,
    whether to run automation, any other arguments, etc. Rename your copy
    to QImportP.cmd
    
    Then copy both QImportP.wsf and QImportP.cmd to a folder
    from where you are going to run the script.

    Running "QImportP" will then run the cmd script.

  Automation :
    As mentioned above, the script accepts a /automate argument. This can
    be used to make the script import the prices directly into Quicken.
    This is a fragile mechanism, here are all the things to try if
    it is not working:

    1) On startup, Quicken must open up with the correct file. Quicken
    will start by opening the file that was used last time it was closed,
    so ensure that the correct file will be opened.

    2) If you have password-enabled your Quicken file, run Quicken first,
    enter your password, and then run this QImportP script with /automate.
    It is not possible or useful to have this script run Quicken in this
    case.

    3) Caps-Lock key should be off.

    4) Do not press any keys while the script is running. It takes
    around 8 seconds to complete the automation work. This can be speeded
    up by removing the delays inserted in the code if needed, but
    given that around 8 key sequences are sent, this allows the user to
    follow Quicken action on the screen in response to the keys. 

===========================================================================
Adding a menu short-cut

This method works on Windows XP as well as Vista, and is a better way
to automate the script rather than depending on the script to start Quicken.

First: create a customized QImportP.cmd file, and copy that and the
  QImportP.wsf to a specific folder. Test that running QImportP.cmd from any
  folder works correctly.
  Create the QImport.cmd script using the example QImportP.cmd.txt file.

Second: Using Explorer, open the folder, and drag-and-drop the QImport.cmd
  file onto the start menu - this will create a custom menu link.

Enable drag and drop operation to add custom menu links to Start Menu.
Note that drag-and-drop should be enabled for this to work, here are the
steps to do that if that does not work.

Right Click on "Start" Menu
Click "Properties"
Click "Start Menu" Radio Button
Click on "Customize" Button
Click on "Advanced" Tab
If the "Enable dragging and dropping" Checkbox is not checked, drag-and-drop
will not work.
Click "Enable dragging and dropping" Checkbox.  Click "Ok" and then "Apply".

===========================================================================
Adding a button on the Quicken Toolbar

[This works for Windows XP and Vista. The above section showing how to add
 the QImportP.cmd to the Start menu is an alternative, avoids editing
 .ini files which can be dangerous.]

If you are not starting "Quicken Home Inventory" or "Quicken Family Lawyer"
from within Quicken, you can use one of these to start QImportP process.
This has been tested for Quicken 2006.

First: create a customized QImportP.cmd file, and copy that the
  QImportP.wsf to a specific folder. Test that running QImportP.cmd from any
  folder works correctly.

Second: edit QUICKEN.INI
  Assuming "Quicken Family Lawyer" is what can be used to start QImportP,
  find your Quicken.ini, and edit it.
  IMPORTANT: back up your Quicken.ini in case of problems editing.

  In Vista, the file may be here:
  C:\Users\USERNAME\AppData\Local\VirtualStore\ProgramData\Intuit\Quicken\Config

  Find the line with AddApps, add ";QFL" to it, like this, if not
  already present:
AddApps=;QHI;QFL

  Then at the end of the file, add a QFL section:
[QFL]
ExeName=C:\temp\QImportP.cmd
MenuString=Quicken Family LawyerX
IntuitID=1023
; use IntuitID=1007 for QHI, and IntuitID=1023 for QFL

  The ExeName should be the full pathname to your working QImportP.cmd script.
---- more detail ----
[QFL]
ExeName=C:\bin\QImportP.cmd
MenuString=Quicken Family Lawyer
IntuitID=1023
IsGlobal=FALSE 
WinTitle=Family Lawyer 
ModuleName=QFL
InformExec=TRUE
; names QHI or QFL can be anything, only the IntuitID matters
; it is 1007 for QHI, and 1023 for QFL
; and the ExeName is what will be invoked when command is run
; need ExeName, MenuString (anything in it) and IntuitID=1023 in QFL section
; Don't need: IsGlobal=TRUE ;WinTitle=XFamily Lawyer ;ModuleName=QFL
; must have .exe or .cmd file name ending, can't use .bat suffix
; InformExec=FALSE or TRUE, .bat file still has same error 
; "Failed to start program C:...\QimportP.bat. This program may not be correctly installed."
; InformExec=FALSE or TRUE for .cmd, works with no Quicken error.
; When InformExec line is not present or is FALSE, Quicken flashes the
; "Command Prompt" DOS window where the script commands execute, so better
; to keep it TRUE.
--------

Third: update Quicken, add a toolbar icon for QImportP.
  Start Quicken, run the Edit -> Customize Toolbar command.
  Check the "Show all choices" box in the "Add to toolbar" section.
  Select "Quicken Family Lawyer" from the choices, and click on the "Add->"
  button. Now this item will show up in the Current Toolbar Order section.
  Select the "Quicken Family Lawyer" in this section, and click
  on the "Edit Icons" button.
  This will allow replacing the icon text, make it "QImportP". 
  Click on "OK" button to dismiss the window, when all done.

Note that the menu command "Property & Debt" will still show this
new command with the old name "Quicken Family Lawyer". But the toolbar
text may show the name typed in the previous step.
  
===========================================================================
Copyright (c) 2009-2010,2015,2017 ACZoom.com
No Rights Reserved.
Placed into Public Domain.
May have calls into external web APIs, which will have 
their own terms of use.
===========================================================================
You can’t perform that action at this time.