Retour à la liste

The power of Typinator forms

In Typinator you can create powerful input forms for filling variable parts of expansions. Such forms are created from input fields that you define in expansions. Input fields can be:

  • text fields in single-line or multi-line forms
  • pop-ups for selecting one from a number of predefined alternatives
  • combo boxes for alternatives with an additional free-text variant
  • checkboxes for choosing one of two text fragments (for "on" and "off") For all these fields, you can specify a default value that is automatically suggested when the field is shown. Without a default value, Typinator automatically suggests the value that was entered at the last invocation.

Input fields are very powerful, as they can be combined with many other Typinator features. For example, you can assign the entered value to a variable, which you can use in different places in the same or other expansions. Or you can pass entered values to scripts. Or you can use the entered values in calculations. The possibilities are virtually unlimited.

The following example gets you started with input fields. For a typical use case, we demonstrate how the input fields can be defined, and finally show the resulting expansion in action. We will start with a simple form and then extend it with more sophisticated features.

Let's assume that we want to prepare a text snippet for an e-mail reply when somebody asks about the most recent version of one of our products, Typinator, PopChar, or KeyCue. We want to enter the name of the customer in the greeting, select the product and choose an option for adding more information about available updates. The boilerplate text could look like this (placeholders shown in italic):

Dear Customer Name,

Thank you for your interest in Product. Bla bla bla, … and further information. To download the new version of Product, please visit our website.

With best regards,
Ergonis Customer Support

The sentence about downloading the new version should be included only if a new version is available. If we know that the customer already has the latest version, we want to replace this sentence with:

You already have the latest version of Product.

When you create the expansion, type "Dear ", then click the {…} pop-up next to the expansion field and select "Input Field…". Typinator opens an "assistant window" that starts with the type "Text Field". This is what we want, so we just need to enter "Customer Name" as the label. We want the text field to start empty (rather than the name that we entered the last time), so we check "Default Value" and leave the corresponding text field empty: TYP-PT_PowerOfForms_01.png

This results in:

Dear {{?Customer Name<>}}

The notation of complex input fields can get complicated, but Typinator helps you with editing them. To modify the definition of an input field, click inside the field. Typinator highlights the entire field definition and displays the field type below the {…} pop-up: TYP-PT_PowerOfForms_02.png TYP-PT_PowerOfForms_03.png To edit the field, simply click the 3-dots symbol to open the assistant. As a shorthand, you can also double-click one of the surrounding braces.

The next field is the product name. At the corresponding location in the expansion, we insert another input field, but now with the field type "Alternatives". The label shall be "Product", and we fill the list of choices with the names of our products. For now, just enter the product names as "Title in Menu": TYP-PT_PowerOfForms_04.png This time, we do not check "Default Value". Typinator will therefore suggest the product that we selected the last time. The expansion now looks like this: TYP-PT_PowerOfForms_05.png

Now enter the rest of the expansion. Instead of the sentence that we want to swap with a checkbox, we insert another input field with the type "Option". We use the label "New version available" and enter the alternative text fragments in the Yes and No sections: TYP-PT_PowerOfForms_06.png Of course, we don't want to say "Product" here, but rather want to mention the previously selected product. To do that, just replace the word "Product" with the definition of the field: TYP-PT_PowerOfForms_07.png You can copy the previous field definition and paste it here in the assistant, but you can also copy/paste it directly in the expansion: TYP-PT_PowerOfForms_08.png When you use the same field definition in multiple places, Typinator still shows this field only once and inserts the selected item in all places. We will use a more elegant technique a little bit later.

The complete expansion now looks like this:

Dear {{?Customer Name<>}},

Thank you for your interest in {{?Product(Typinator|PopChar|KeyCue)}}. Bla bla bla, … and further information. {{?New version available(1:To download the new version of {{?Product(Typinator|PopChar|KeyCue)}}, please visit our website.|0:You already have the latest version of {{?Product(Typinator|PopChar|KeyCue)}}.)}}

With best regards,
Ergonis Customer Support

Now it's time to try the expansion.

John asks about Typinator, but we know that he already has the latest version. We type the abbreviation and complete the form like that: TYP-PT_PowerOfForms_09.png The result is:

Dear John,

Thank you for your interest in Typinator. Bla bla bla, … and further information. You already have the latest version of Typinator.

With best regards,
Ergonis Customer Support

Mary asks about PopChar, but she has an older version. Again, we type the abbreviation. This time we complete the form like that: TYP-PT_PowerOfForms_10.png The result is:

Dear Mary,

Thank you for your interest in PopChar. Bla bla bla, … and further information. To download the new version of PopChar, please visit our website.

With best regards,
Ergonis Customer Support

Now let us fine-tune our expansion: When an expansion contains multiple occurrences of the same field, it is often easier to assign the input to a variable and then use that variable in multiple locations. To do this, we modify the first occurrence of the Product field and specify the name of the variable: TYP-PT_PowerOfForms_11.png The field now looks like this:

{{productName=?Product(Typinator|PopChar|KeyCue)}}

It assigns the selected product to the variable "productName", but it does not insert the result in the expansion. We therefore need to actually use the variable after the assignment with the notation {{productName}}:

{{productName=?Product(Typinator|PopChar|KeyCue)}}{{productName}}

To reuse the variable in other places, we just need to insert {{productName}} where we need the product name. In the option field, the Yes and No results now become simpler: TYP-PT_PowerOfForms_12.png The advantage of this technique is that we need to make changes to the Product field only in a single place.

We have Mac and Windows versions of PopChar. To make that clear, we now want to change "PopChar" to "PopChar/macOS", but we don't want this additional text to appear in the pop-up. We can do this by specifying an "extended text result" for this alternative: TYP-PT_PowerOfForms_13.png When we select "PopChar" from the menu, we now get:

Thank you for your interest in PopChar/macOS. Bla bla bla, … and further information. To download the new version of PopChar/macOS, please visit our website.

Extended text results can be used for longer text fragments. You could, for example, use a pop-up to select one of five paragraphs with explanations.

As a last step, let's extend the expansion to allow free text for the product. All we need to do is enable the "Allow free text" checkbox in the assistant: TYP-PT_PowerOfForms_14.png When we use the expansion now, we get a "combo box" instead of a pop-up field: TYP-PT_PowerOfForms_15.png We can still click the blue menu button to select one of the predefined choices, but we now can also enter other product names.

Here is the final expansion that does all this:

Dear {{?Customer Name<>}},

Thank you for your interest in {{productName=?Product(Typinator|PopChar:PopChar/macOS|KeyCue|…)}}{{productName}}. Bla bla bla, … and further information. {{?New version available(1:To download the new version of {{productName}}, please visit our website.|0:You already have the latest version of {{productName}}.)}}

With best regards,
Ergonis Customer Support