Typinator Part 6 - Advanced Abbreviations Part 2


Here we have the last post on Typinator and I will be covering some abbreviation examples that this powerful piece of software is able to provide. 

IMAGES

If you have image files or pictures that you frequently find yourself inserting into documents, then instead of an abbreviation leading to a text output, you can have it expand into… an image instead!

By placing an image file in the Includes folder, you are able access these files in the same way you would access a text file

SIGNATURES

Signatures are a brilliant use for Typinator, especially if you work in an environment where you may nee dot use different signatures for different parts of your business. I have three signatures myself, all with a very simple abbreviation - yysig1, yysig2 and yysig3. 

You will achieve the best results for signatures by changing the Expansion output from Plain Text to Formatted Text as this will give you the opportunity to be able to change the Font formatting of your text to add some real polish to your signature and give you the chance to stand out. 

INTERACTIVE INPUT

Typinator doesn’t just look after expanding your predefined static text. No sir. It knows that there will be times when the results of the expansion will need to change. For example, let’s say that you have a thank you letter you wish to send out to customers, thanking them for their continued support. You don’t want to send out a letter that just says “Dear Customer. Thank you so much for your valued custom over the last twelve months”. This is one of my bugbears as, as nice as it is to receive a letter from someone you’ve been giving your hard-earned money to, you know that essentially they’ve just copied and pasted a letter or just added your name to a mailing list. 

By using Interactive input fields, you can personalise the content of the expansion whilst still saving time by ensuring that the majority of the content will stay the same for subsequent expansions. 

Let’s start with a simple example of how Interactive input works. 


If you look at the above image, you can see the text that has been typed in the expansion window is: {{?First Name}} {{?Last Name}}

The question marks inside the curly brackets indicate that a question is being asked and the text that is going to be displayed will be the result of this text. 

So - when you type yyname into an application, you are presented with the following pop up box

 

By inputting this information and clicking enter, the text expands into the results below. Well, if your name is Joe Bloggs of course. I’m still waiting to meet this elusive character. To date, he has evaded me but one day…

Remember that the format of expansion is the same as if you were expanding static text. Because I have a space between {{?First Name} and {{?Last Name}}, the name is displayed with a space between the forename and surname. If I was to type the expansion into the expansion window as follows:

{{?First Name}} {{?Last Name}}

Then the result we would see above would be: Joe Bloggs. 

This is something to consider, especially if you are using the expansion for creating formal letters for customers, or any other document that relies on strict formatting guidelines. 

Typinator remembers the last entry that was completed which can prove to be handy if you find yourself entering the same values more than once. So above, the next time yyname is typed, the fields will already be populated with Joe and Bloggs. 

If you wish, you can specify an initial value by using angle brackets within the curlys. Using the example above, let’s say we live in a really freaky world whereby the majority of my customers are called Neville. I could repopulate the First Name tab by typing the following as my expansion:

{{?First Name}} {{?Last Name}}

One other thing you can do is assign interactive input fields within an expansion. For example:

{{closingDate=?Closing Date}}

The above will take the variable ‘closingDate’ and will only appear when the user is prompted, elsewhere within the variable, to input text using the {{?Closing Date}} marker. Very clever. Typinator is getting you into the mechanics of scripting in a very easy way!

CALCULATIONS

So when you purchased Typinator, were you aware that it had the ability to be able to function as a calculator and automatically expand mathematical calculations? No? Nor was I! It was only when I saw it discussed on a forum that I realised this and the automation part of my brain starting thinking of ways that this could be useful. 

Before I move on to how I’ve been able to add calculations to my workflow, let’s go over the basics of how they work. 

Calculations are reliant on the use of the number sign (#) in their creation. Let me show you an example below: {{#dailyrate*totaldays}} 

The calculation above will workout the calculation based on two pre-defined variables - dailyrate and totaldays. So where have these variables been pre-defined? Well, they may have already been given values during another abbreviation. You see Typinator is very clever in that once you have assigned a value to a variable, that value will stay, even if the machine is rebooted. Pretty clever huh?

You can move this a step forward and assign a calculation value to a completely new variable:

{{amountdue=#dailyrate*totaldays}}

Now it’s important to know that when the above expansion is performed, it will not present you with an output. No sir. That is not the way that variables work. All you are doing is telling Typinator how to perform a calculation should it ever be required in an expansion in the future. 

So let’s move this forward a bit to clarify a little more. 

{{dailyrate=?dailyrate}}{{totaldays=?totaldays}} {{amountdue=#dailyrate*totaldays}}

The amount payable is £{{amountdue}}

OK, what have we done above. Well, in the first line, you can see that we have asked to manually input the values for both Daily Rate and Total Days. The second line sets a value for the amountdue variable. Remember, this doesn’t produce a visible output. Typinator is merely making a calculation for itself later, should the {{amountdue}} variable ever appear. In the third line, we want to see the output of this calculation so we place it into a visual expansion, with the calculation appearing after the £ sign. 

I use this when creating invoices for my clients because with a few simple keystrokes, I’m able to produce a nice, detailed invoice with the day rates, VAT amounts, total payable etc calculated and filled in as I go. 

How would displaying the VAT amounts work? Well, something like the below would be handy:

{{dailyrate=?dailyrate}}{{totaldays=?totaldays}}

{{amountdue=#dailyratetotaldays}} {{vatdue=#amountdue/10020}}

The amount payable is £{{amountdue}} The VAT payable is £{{vatdue}}

I’ve entered a variable above, vatdue, that will take the output of the amountdue variable and perform a calculation based on it. It’s then available to be displayed in the bottom line of the expansion. 

Also, these calculations are not just to be used within the expansion that they have been created in. You can use these within other expansions as well. For example, VAT is set at a standard 20% in the UK, so I have one calculation for the amount of VAT to pay which doesn’t need to be modified within any other abbreviation at all. It hasn’t been changed since I started using the application. 

Let’s put some decimal points within the above expansion. Dead simple. 

{{dailyrate=?dailyrate}}{{totaldays=?totaldays}} {{amountdue=#dailyratetotaldays:2}} {{vatdue=#amountdue/10020:2}} The amount payable is £{{amountdue}} The VAT payable is £{{vatdue}}

The :2 that appends the amountdue and vatdue calculations will display the result to two decimal places. 

I also use Typinator to calculate the due date of the invoice. The following expansion works a treat for this:

Payment is expected in full by {{dayDelta=+30}}{NN} {D} {YYYY}

The above will write out the date 30 days from the time the expansion takes place, which is generally the date you are writing the invoice. You can of course set a reference date for this.

So you see how easy it is to build up an Invoice expansion, piece by piece, with Typinator? Just think of the hours it could save you just with that function alone.

Calculations are without doubt a very powerful feature of Typinator. There are downloadable extrasavailable from Typinators website that allow you to do even more with them. Wouldn’t it be good to have the Invoice expansion you have created above automatically calculate the amount in another currency? It’s possible. Let’s look at how to do it. 

CONVERTING CURRENCY

In order to convert currencies, you will need to download the Convert AppleScript from the Ergonis Support Site. Instructions for install can be found within the downloaded folder. 

Once installed, you are able to click on the (…) on the right hand side, select Scripts and then Convert.

If you follow the instructions fully you will also have Predefined Set installed called Convert Script Samples. 

Let’s take a close look at what we have in the Predefined set and see if we can make sense of it. 


What can we note from the above based on what we have learned so far. Well:

The conversion is kicked off by typing the abbreviation 1$? Into any window. 
The first line of text you will see will be:

    Today (August 28, 2014), one US$ is equivalent to:

Or whatever the equivalent date is. 

- A calculation is going to be performed. This is shown by the presence of the # symbol. 
- A script is going to be processed in order to provide a mechanissm for performing the calculation. This script is called Convert.applescript and is located within a folder called Scripts. It is not specified explicitly but we know that this Scripts folder is located within our Includes folder. 
- 1 US Dollar is going to be converted against eight other currencies, to two decimal places. The two decimal places is denoted by the presence of the :2 within the expression. 
 - The name of the currency that the dollar is being converted against will be displayed. 


Therefore, the output of the abbreviation 1$? Will be similar to the following:

Today (August 28, 2014), one US$ is equivalent to: 1.07 AUD (Australian Dollars) 1.08 CAD (Canadian Dollars) 0.91 CHF (Swiss Francs) 0.76 EUR (Euro, €) 0.60 GBP (British Pound, £) 60.44 INR (Indian Rupees, ₹) 103.73 JPY (Japanese Yen, ¥) 31.91 THB (Thai Baht, ฿)

So how is the script able to get the information required to perform this calculation? Well, an online currency converter is called as part of the process (https://www.google.com/finance/converter) so you will need to ensure you have a working Internet connection in order to perform this action. 

This is just one example of how this script can be used. Let’s look at the other scripts included in the Predefined Set and you should be able to get more of an idea as to how you can manipulate the script and these expressions to suit your own purpose. 

HOW MUCH IS THIS ITEM WORTH IN DOLLARS?

 

What we see here are variables in action. The * characters denote that the values need to be manually added, with the output coming out in US Dollars. 

For example, if we type:

5 EUR $$

We will be presented with the output:

6.61

Dependant on the current exchange rate of course!

WHAT IS THE CURRENT EXCHANGE RATE AGAINST DOLLARS FOR A SPECIFIC CURRENCY?

 

The expansion above takes that point and limits the output a little more, telling you exactly what a single unit of the currency you wish to convert is worth in dollars. 

EUR>$

$ 1.3211

So this is handy if you just need to know what the exact exchange rate is at any given time.

Can you get a list of more currencies? Indeed you can. What you will need to do is invoke the script with the following text:

{Scripts/Convert.applescript codes}

You will be presented with a long list of available codes for use. 

The posts I have made are by no means a complete ist of everything that is able to be achieved with Typinator - not at all. The team at Ergonis are innovating all the time, with new features and scripts beinfg released, so if you use the software, it is a good idea to keep checking their Download Extras site for new scripts and sets.