Terry's ORA Tips

Template Example – Newspapers.com Sources

This page updated 25 Oct 2020

Version note: Applies to ORA 1.11

This article describes one of my example Templates for Online Repository Assistant (ORA). The other example Templates can be found in the index of Example Templates. Other articles in my ORA Section cover various topics about using the software. The "How it Works" section below includes links to articles describing the ORA features used in these Templates.

Description:

The set of Templates described here are designed to create Source definitions for Newspapers.com clippings – obituaries or newspaper items – in TMG. These Templates are designed to work with "splitter" style sources, where a new Source Definition is defined for each clipping. In addition, there is a Text Template designed to produce a filename for the image of the item when it saved, and a separate Text Template to format the subject's surname when used by the other Templates.

The Templates are designed to work with Newspapers.com clippings, but could easily be adapted to work with other Collections that are used with "splitter" style sources. I have not tested them with other genealogy programs, but they could no doubt be adapted to them as well, or at least illustrate techniques useful for other applications.

Example Output:

Filename Template:

D:\Genealogy\Sources\Newsclips\from Newspaper.com\1994-11-27 Lansing State Journal - Cramer, Patricia A obit

Obituary Template:

Obit source

Clipping Template:

Clipping Source

Type:

The Source Definition Templates are Auto Type, intended for use with TMG. The filename Template is a Text Template, which can be used with any application. The surname Template is a Text Template, designed to be used with the obituary and filename Templates.

Use:

In TMG, open a Tag Entry screen for a Tag in which you intend to cite the new Source.

In your browser, navigate to the newspaper page containing the item in Newspapers.com for which the Source is being created. In the ORA Control Panel, click the Auto Type button associated with the desired Template. The Template opens a Citation screen, changes that screen to the "New" mode, and creates the Source Definition in that screen. After verifying that the text entered is correct, close the Citation screen and the new Source is created.

When saving the image, copy the filename from the ORA Clipboard, then save the image in the normal way, pasting the filename into the File Save dialog box when it opens. Additional details may need to be typed in to the filename depending on the information available to ORA for the particular item.

Limitations:
How it Works:

The set of Templates includes two Text Templates. One cleans up various issues with the way the name of the subject of an obituary may be recorded, for use by the obituary and filename Templates. The other creates the filename to be used when an image of the item is saved. Two Auto Type Templates create the Source Definition for the obituaries and newspaper clippings respectively. This discussion will start with the Text Template to process the name of the subject.

Name Cleanup Text Template:

The heading of this Template must be entered as "Name" in order for it to be used in the filename and obituary Templates. If another label is used the "Name" variables in those Templates must be changed accordingly.

Since names of subjects sometimes appear in Newspapers.com in mixed case and sometimes in all upper case, the Template starts by changing each name part to initial capitals only, with an Assignment Variable and the :capitalize Transform:

[=Name:[Name:capitalize]]

The Assignment Variable sets the "Name" field equal to itself but with case changed to initial capitals for each name part.

I find that obituary clippings often have "obituary" or "obit" as part of the title of the clipping, which ORA collects as part of the Name field. The next step of Template is to remove those terms if they are present with these two segments, using the :replace Transform;

[=Name:[Name:replace: obituary:]]
[=Name:[Name:replace: obit:]]

These segments search for a space followed by the terms "obituary"and "obit" respectively, and if found replace them with nothing. If the search terms are not found, change is made.

In order for the results of a Template to be used by another Template it has to actually produce output. So the final step is create that output, which can be done by simply using a Variable to output the processed name:

[Name]

However, in this example I have elected to do further processing to deal with the special case of surnames beginning with "Mc" which I have been working with. The example Template below include this processing, which you may choose to keep, replace with just the name Variable as shown above, or replace with similar code to process other special surnames you encounter in your research.

My method for processing "Mc" surnames involves two steps to restore the capital letter following "Mc" if the surname starts with those letters. The first step uses the Assignment Variable and the :replace Transform to find the letters "Mc" at the beginning of a word and if found place a temporary semicolon after them:

[=:Name:[Name:replace:\b(Mc)([a-z]):$1;$2]]

The :replace Transform searches for the letters "Mc" at the beginning of a word, followed by another letter, as shown in green above. If found, the parentheses around "Mc" place those letters in a group, and the parentheses around the term "[a-z]" places the following letter in a second group. Finally, if the searched for term is found, the "$1;$2" term, shown in pink above, replaces the "Mc" and following letter with the same letters, but now separated by a semicolon If the "Mc" is not found the whole :replace Transform is ignored, and the value of the "Name" Variable is unchanged..

The final step is to output the entire name, capitalizing the part of the surname that follows "Mc" if it was found by the preceding step. This is done by using the :split Transform twice to separate the "Name" into parts separated by the semicolon, if that was created by the preceding step, and applying the :capitalize Transform to the second part:

[Name:split:;:1][Name:split:;:2:capitalize]

If there is no semicolon in the surname, because no "Mc" was found above, the entire name is output by the first term and the second term is ignored. In either case, the "Name" now appears at the bottom of the Control Panel, and more importantly for our purposes, is available for use by other Templates.

The output of a Text Template can only be used by another Text Template of a higher number, so this Template must be placed to the left of the filename Template described next. Also, during testing, the output of a Text Template is only available for testing in another Template after it has been evaluated by refreshing the Control Panel or moving to a different record.

Filename Text Template:

This Template generates a filename, or in some cases a part of one, to be copied and pasted into a File Save dialog box when saving an image of the clipping.

The filename generated includes the path to the target folder so the user does not have to navigate to that folder manually. In keeping with my preferences, it includes the name of the newspaper and the issue date. If the name of the subject is available, as it sometimes is for obituaries, that is included. Otherwise the description of the item must be typed in after pasting the part that is generated.

The Template begins the value of the "Name" field as cleaned up with the Template described above.

I prefer that filenames not

Next it removes any periods that may appear after initials, because I prefer not to include periods in filenames. This is done with the :replace Transform that searched for periods in the name, that may be after initials, prefixes or suffixes, and replaces them with nothing:

[=Name:[Name:replace:\.:]

The :replace period in the "search for" string is preceded by an escape character – a backslash – because the period has special meaning in the regular expression that is the default mode of the replace Transform.. The resulting name without the periods is then assigned to the Name field by the Assignment Variable. If no period is found no change is made.

Next the actual filename is assembled. First, the path to the folder where the image is to be stored is created with literal text. See my example Filename for details about how this can be done.

My preferred format for filenames for newspaper clippings starts with the date, the name of the newspaper, a hyphen, followed a brief description of the item. The first part is created from the Date field and the name of the newspaper from fields ORA captures from the record:

[Date:date:yyyy-mm-dd] [Paper] -

The Date field had a :date Transform to convert it to year, month, day format so the items sort by date in a list of files. This Transform is required because I have set a different format for general use of the Date field in the OraSettings page. That is followed by a space then the field with the name of the newspaper, then a space, hyphen, and another space as literal text.

Finally, if the name of the subject is available, as it may be for obituaries, it is added with the following segments:

<[Name:nameSurname], <[name:namePrefixraw] >[Name:nameGiven]<, [Name:nameSuffixraw]> obit>

The names using the [Name] variable created in the preceding Text Template various versions of  the :name part Transforms. The surname is place first, followed by the literal characters for comma and space. This term is followed by terms for the prefix (Dr., Gen., etc.), the given name, and the suffix (Jr., Sr., II, etc.). The prefix and suffix terms are enclosed in Conditional brackets along with their associated spaces and comma so those characters are not output if the name parts do not exist in the record. In addition, the "raw" versions of the prefix and Suffix transforms are used because the regular versions "standardize" those items by adding periods in some cases, which I prefer not to include in filenames as mentioned above.

The the literal text "obit" is added at the end. Conditional brackets are placed around the whole name sequence so that the literal text "obit" does not appear if there is no name field.

Auto Type Templates:

The Auto Type Templates are intended to generate a complete Source Definition in TMG, starting with an open Tag Entry screen. The Templates use the "Expanded" Citation screen, rather than the Source Definition screen, because the latter is a tabbed screen that requires changing tabs to enter the Comments Source Element. By using the expanded Citation screen a new Source can be created from a single data input screen in TMG, avoiding all the Control Sequences needed to navigate the tabs in the Tag Entry screen.

The Templates gather data from fields available in the ORA Control Panel and format it to create output for each Source Element. When needed data items are not available the user is prompted to enter them manually. The methods used are explained for each Source Element below. When the two templates require different methods, each is explained. The {tab} Control Sequences used to advance from field to field are included in the Templates at the end of this article, but are not shown in the following discussion for each segment.

For obituaries, the subject's name is often available, and the processed version from the name cleanup Template described above is used. For clippings other than obituaries, there is generally no person's name indexed, so that template uses the Assignment Variable to prompt the user to provide the text to be used in the Source "Abbreviation" field, and also the title of the article being clipped:

[=:Abbreviation]

[=:Article-Title]

Both Templates open the Citation screen in TMG with the Control Sequence for the F4 key. That screen opens with the focus on the Source Number field. The Control Sequence for the shift-tab combination tabs "backwards" to the "New" radio button. A literal space character selects that radio button and the focus advances to the Source Type drop-down list.

{F4}{SHIFT+TAB} {300}

It takes TMG a finite amount of time to change the Citation screen from the "Old" mode to the "New" mode, which requires re-drawing that screen. I find to get dependable results in selecting the Source Type with the following step I need to add a delay Control Sequence to give TMG time to catch up. I have found a 300 millisecond delay works on my system, but you may find a shorter delay works for you, or you may need a longer one.

The Source Type is selected from a drop-down list. Items on that list cannot be reliably selected by typing the name of the Source Type when there are several items that begin with the same terms, particularly when the names include spaces or other special characters. One method that has been found successful is to type a few letters of the beginning of the name, add a delay Control Sequence to let TMG find the first item starting with those characters, then type the same letters again to advance to the next item with the item with the same beginning characters, and repeat until the desired item is found. For my system the following Template segment finds the "Newspaper Obituary - Custom" Source Type:

news{800}news{800}news

I have several Source Types that begin with "news" so three attempts find the correct one for the obituary Template, and one for the newsclip Template. To use this Template on another system you would need to change the characters typed to match the name of your Source Types, and the number of repeats, if any, to match the list of Source Types on your system. I found the 800 millisecond delay worked on my system to allow TMG to select each Source Type in turn, but you may find a shorter delay or longer one works best for you.

An alternate method is to be sure that the Source Types have unique names up to a point before the first space or special character. Doing so allows the Template to work by just typing in enough letters to uniquely select the desired Source Type.

The formatting of the Source Abbreviation in TMG is totally a matter of personal preference. I prefer to start my obituary Source abbreviations with "obit- " so all my obituary Sources sort together in the Master Source List, followed by the name of the subject, surname first. For example:

obit- Cramer, Patricia A

That output is produced by the following Template segment:

obit- [Name:nameSurname], <[name:namePrefix:replace:\.:] >[Name:nameGiven:replace:\.:]<, [Name:nameSuffix:replace:\.:]>

With the exception of the literal text "obit- " at the beginning this is the same Template segment as described above for the Filename Template, except that the :replace Transform to remove any periods is placed within the individual terms because I want those periods included in other uses of the Name Variable below.

For the newsclip Source I prefer that the Abbreviation start with "newsclip-" followed by a brief description of the subject of the article. For example:

newsclip- McNeill, Rivers estate

That output is produced by the following Template segment, which simply uses the literal text "newsclip - " followed by the [Abbreviation] Variable to output the text entered by the user at the earlier prompt:

newsclip- [Abbreviation]

The Title Source Element is not used in my newspaper clipping Source Types, so I repeat the same text with the same Template segment for that Source Element.

The name of the newspaper is entered with the [Paper] variable:

[Paper]

The obituary Template types the name of the subject, surname first, using the same Template segment described above for the Source Abbreviation, except the Transform to remove periods is omitted:

[Name:nameSurname], <[name:namePrefix] >[Name:nameGiven:replace\b([a-z]) [ ]:$1.]<, [Name:nameSuffix]>

The newsclip Template instead enters the name of the article, using the [Article-Title] Variable to output the text entered by the user at the earlier prompt:

[Article-Title]

While my newsclip Source Type allows for a short form of the article title, this Template does not support that distinction, so the same title is repeated for the short title. I find I seldom make them different, so instead of having to enter both of them each time I use the Template, I manually edit one or the other after the Template has finished creating the source definition when I find a case that merits them being different.

The remaining elements of both Templates are the same. The date of the newspaper and the location of the paper are output with Variables with data from the record:

[Date]

[Location]

I find that Newspapers.com is inconsistent about how it indexes the page number of the clipping. In some cases the page number appears by itself, and sometimes the field contains the label "Page" separated from the number with a space. The Template deals with that by including the literal text "pg " in order to get uniform results in my preferred format, then applies a :split Transform to output only the last segment, the actual number, from the Page field:

pg [Page:split: :-1]

If only the number is in that field, the "last" (only) segment is that number, and if the text "Page" is present the last segment is just the number.

Finally, I enter the name of the repository in which I found the clipping with literal text:

Image found online on Newspapers.com
 
Templates:

The following are the complete Templates for the obituary and newspaper clipping items. They can be copied from the areas below and pasted into Text or Auto Type Templates in the OraSettings window. Changes in various elements as described above will likely be required to suit your system and methods. The separation of the coding into "paragraphs" is used only to make the coding easier to understand. The paragraph breaks are ignored by ORA when the Template is used.

Name (Text Template):

[=Name:[Name:capitalize]]

[=Name:[Name:replace: obituary:]]

[=Name:[Name:replace: obit:]]

[=:Name:[Name:replace:\b(Mc)([a-z]):$1;$2]]

[Name:split:;:1][Name:split:;:2:capitalize]

Filename (Text Template):

[=Name:[Name:replace:\.:]]

D:\\Genealogy\\Sources\\Newsclips\\from Newspaper.com\\[Date:date:yyyy-mm-dd] [Paper] -

<[Name:nameSurname], <[name:namePrefixraw] >[Name:nameGiven]<, [Name:nameSuffixraw]> obit>

 

Obituary (Auto Type Template):

{F4}{SHIFT+TAB} {300}{fast}news{800}news{800}news{tab*3}

obit- [Name:nameSurname], <[name:namePrefix:replace:\.:] >[Name:nameGiven:replace:\.:]<, [Name:nameSuffix:replace:\.:]>{tab}

obit- [Name:nameSurname], <[name:namePrefix:replace:\.:] >[Name:nameGiven:replace:\.:]<, [Name:nameSuffix:replace:\.:]>{tab}

[Paper]{tab}{tab}{tab}

[Name:nameSurname], <[name:namePrefix] >[Name:nameGiven:replace\b([a-z]) [ ]:$1.]<, [Name:nameSuffix]>{tab}

[Date]{tab}

[Location]{tab}

pg [Page:split: :-1]{tab}

<[name:namePrefix] >[Name:nameGiven:replace\b([a-z]) [ ]:$1.]<, [Name:nameSuffix]>{tab}

Image found online on Newspapers.com

Clipping (Auto Type Template):

[=:Abbreviation]

[=:Article-Title]

{F4}{SHIFT+TAB} {300}news{fast}{tab*3}

newsclip- [Abbreviation]{tab}

newsclip- [Abbreviation]{tab}

[Paper]{tab}

[Article-Title]{tab}

[Article-Title]{tab}{tab}

[Date]{tab}[Location]{tab}

pg [Page:split: :-1]{tab*2}

Image found online on Newspapers.com{tab}

 

ReigelRidge Home Terry's Tips Home Contact Terry

 

 

Copyright 2000- by Terry Reigel