Launch Ancestral Sources from Family Historian

In common with many other Windows applications, Ancestral Sources can be called with specific Command Line options for opening the application in a pre-determined configuration. This can be used by a Family Historian plugin to set option values prior to calling Ancestral Sources .

The principal options are as follows:

-FILE path path is the full Windows file path to the GEDCOM file to be loaded (which is usually a project GEDCOM, but does not have to be – Ancestral Sources can be used completely independently of FH if required).
-IND id id is the Record Id of the Individual to be loaded.
-SOURCE type type is the type of fact to be added, and can be CENSUS, BIRTH, BAPTISM, MARRIAGE, DEATH or BURIAL (mirroring the option buttons on the application toolbar), as well as IMAGES for adding images to current sources.
-CLOSE closes AS after saving the active entry to file.

If you always run Ancestral Sources using the same project and/or individual selected, it is therefore possible to configure your shortcut to the application using these values (or Ancestral Sources’ own default file option), but to identify the current individual or use or a variable project name requires a simple plugin. Fortunately, this can be achieved using basic FH plugin functions.

The code snippet below provides a basic working model for a simple Ancestral Sources launcher, starting the application with the current Project and Individual already loaded (or the default Ancestral Sources individual if one is not active). It first looks for the more common 64-bit version of Ancestral Sources, then falls back to the 32-bit version if that is all that is available. If neither version is installed, it flags the error to the user and exits.

The code can be used either “as is” for a basic launcher plugin (ideally added to the Family Historian Tools menu for ease of access), or as the basis of a more highly customised plugin tailored the user’s specific requirements.

Note that the code is deliberately constructed using a fairly verbose style with multiple comments to explain what it is doing. More experienced plugin authors can of course delete the comments and condense the code considerably if preferred.

(Admin note: code deleted as no longer accurate. To be updated)