Back to list

Phrases depending on the time of the day

Suppose you want to insert the words "morning" or "afternoon" in an expansion, based on the current time of day. You can do this by combining the AM/PM marker with the built-in /Replace function like this:

{/Replace /AM/morning/PM/afternoon//{A}/}

{A} produces AM or PM, depending on the current time. The /Replace function then translates AM to "morning" and PM to "afternoon".

If you need this in multiple expansions, you can use a nested expansion (Typinator 6.4 or newer) to simplify usage of this pattern. To do so, create an abbreviation that you will hardly ever type by hand, such as "mornaft", with the expansion above.

Once you have done this, you can use this item in any other expansion by writing

{"mornaft"}

When you select the option "Case affects expansion" for the "mornaft" abbreviation, you can also write {"Mornaft"} to create "Morning" or "Afternoon" at the beginning of a sentence.