Terry's ORA Tips

Template Example – Newspapers.com Sources

This page updated 9 Feb 2021

Version note: Applies to ORA 1.17 or later

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.

Obituaries "clipped" by Newspaper.com's automated system contain a field labeled Name for the name of the subject. Clippings created by users do not include a Name field, but do include a Clip Title field containing whatever the user entered, which for obituaries often starts with the name of the subject. If there is no existing clipping, you can create one yourself, which ORA will recognize after you refresh the ORA Control Panel. The template starts with a term that checks whether the Name field is present, and if not assigns the contents of the Clip Title field to the Name Variable:

<[?:Name]|[=Name:[Clip Title]]>

This segment uses the Value Test Variable, placed within Alternates Conditionals, to see whether there is content in the Name field. If there is, the Conditional is satisfied, and no other action is taken. If not, an Assignment Variable places the contents of the Clip Title field in the Name Variable.

Since names of subjects sometimes appear in Newspapers.com in mixed case and sometimes in all upper case, the Template changes 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," and sometime other data, such as date of death, in the Name or Clip Title fields. The next step of Template is to remove those terms if they are present using the :replace Transform:

[=Name:[Name:replace: Obit.*:]]

This segments search for a space followed by the terms "obit" and if found replace it and any text that follows with nothing. The :replace Transform uses the regular expression feature, searching for the literal term " Obit" followed by zero or more characters, which is specified with the ".*" part of the expression. If the search terms are not found, no 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, is done by simply using a Variable to output the processed name:

[Name]

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 with the value of the "Name" field as cleaned up with the Template described above.

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 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, the title and subtitle of the article being clipped:

[=:Abbreviation]
[=:Article-Title]
[=:Sub-Title]

If there is no sub-title, use the enter key, or click OK without entering anything in the prompt.

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, and the [Sub-Title] Variable if used, to output the text entered by the user at the earlier prompts:

[Article-Title]<: [Sub-Title]>

The [Sub-Title] Variable and its preceding colon are enclosed in Conditional Brackets so the colon and space will not appear in the output if there is no sub-title.

The Short Title Source Element is populated with just the [Article-Title] Variable.

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. I have included Comment lines, proceeded with an " # " character, to describe each step.

Name (Text Template):

# Use "Clip Title" (from user-created clips) if Name is not present
<[?:Name]|[=Name:[Clip Title]]>

# Apply standard capitalization in case name is in all caps
[=Name:[Name:capitalize]]

# Remove "Obit" and any following characters
[=Name:[Name:replace: Obit.*:]]
[Name]

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]

[=:Sub-Title]

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

newsclip- [Abbreviation]{tab}

newsclip- [Abbreviation]{tab}

[Paper]{tab}

[Article-Title]<: [Sub-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