User Guide

Smart TextReplacement

User Guide

Click here for a list of helpful hotstring examples you can copy and use

What is a Hotstring?

The term "Hotstring" used in this user guide refers to the textual command required to perform a text replacement.


This hotstring will act out a command (replace text) based on a short text trigger.

When you start typing and a set sequence of key combinations are type out that match the trigger text command, it will perform the text replacement you have pre-set.


All these hotstring commands must be entered in the "SavedText.txt" file, which must reside in the same folder as the application executable file.

How do you build a "hotstring"?

There are 2 requirements to a hotstring command:

  1. You need a trigger, which is normally a few characters
  2. The replacement text you want entered, when the trigger is matched (typed out)


The 2 elements of the hotstring mentioned above are separated by 2 pairs of colons

::<trigger text>::<replacement text>


Note there are no spaces between the pair of colons. If you add a space before the trigger or replacement text it will be used as part of the trigger or in the replacement

The complete code combination shown above is a complete hotstring.


There must always be 2 colons between the trigger and the replacement text, i.e. the last pair of colons


However, you can add some special characters between the 1st set of colons to determine how the trigger text should work, or how you want the replacement text to be added. This is explained later on under "Special Characters"


If there are no characters between the 1st set of colons, the replacement text will match the case sensitivity of how you typed the trigger text. Therefore, if you type the trigger text in uppercase, the replacement text will be in uppercase, and the same goes for all lowercase or title case. For example this hotstring

::btw::by the way


If the trigger text is typed as BTW it will replace BTW with BY THE WAY. If typed as btw it will be replaced as: by the way


Ending Character(s)

As part of the default hotstring shown above, it will only act on the trigger commend when an ending character is pressed after typing the trigger text. This is normally a character like space or return(enter) or the tab key.

The default ending characters are  -()[]{}:;'"/\,.?!`n `t


Note that `n represents the Enter key and `t represents the tab key and there is a plain space between `n and `t

The end character is also included at the end of the replacement. For example: if you typed btw! it would show as: by the way!





Note: that the end characters in the SavedText.txt file provided with the initial install has been set to only respond to a space, return(enter) or tab key.


Special Characters

Special characters will determine how each trigger is matched, and how the replacement text is written.


They can only be entered between the 1st pair of colons


For example: adding a single character :c: between the 1st set of colons, means the trigger text would be case sensitive.

Therefore, if the trigger text was written in uppercase, it will only make the replacement if you type it in uppercase. Typing in lowercase would have no effect.

This special character also means that the replacement text will be written exactly as you have entered it, with regards to case sensitivity.


Below is a list of the special characters and their functions

* = ENDING CHARACTER NOT REQUIRED

In the previous example above for "by the way" you must type an ending character after typing btw, such as Space, ., or Enter to trigger the replacement.


You can remove the requirement of the ending character by entering an asterisk * between the first set of colons, as in this example:

:*:btw::by the way

Now as soon as you type btw it will trigger the replacement without any ending character


If you still want to include a character like a space at the end of the replacement text, enter the space followed by the accent/backtick ` character i.e. :*:btw::by the way `


You can also set a specific ending character to apply to a hotstring. For example

:*:btw`t::By the way 

The above code will only trigger when the tab key is used as the ending character. The tab key is defined as `t

c = CASE SENSATIVE TRIGGER TEXT

This has already been covered in the example of using special characters above.


The c character added between the 1st pair of colons sets the character case of the trigger text. If entered in lowercase, it will only make the replacement if the trigger is typed in lowercase, and the same goes for uppercase trigger text.


However, the replacement text is unaffected by the case sensitivity. It is fixed by the exact way you have entered it.

For example :c:BTW::by the way is only triggered if "btw" is entered in uppercase i.e. BTW


You may also include multiple special characters, for example the below would remove the end character requirement and only be triggered if typed in lowercase:

:*c:btw::by the way

c1 = CASE INSENSATIVE TRIGGER TEXT

This will ignore the typed case of the trigger text, and enter the replacement text exactly as entered.

For example

:c1:btw::By The Way

You can type the trigger in any case type i.e. upper or lower to initiate the replacement text, but the replacement text will ignore the case type or the trigger text, and be written exactly as you have entered it.

? (question mark) = TRIGGER INSIDE A WORD

The hotstring will be triggered even when it is inside another word; that is, when the character typed immediately before it is alphanumeric. For example, if :?:al::airline is a hotstring. Typing "practical " would produce "practicairline", because the trigger text al is part of the word in practical

b0 (B followed by a zero) = DO NOT REMOVE TRIGGER TEXT

Automatic backspacing is not done to remove the abbreviation you type. 

This can also include a number within brackets {left 5} to define where the text cursor will end up after being triggered

For example:

:*b0:<em>::</em>{left 5}

Typing <em> will produce <em></em> with the text cursor set between the words i.e. <em>|</em> 

O (letter) = REMOVE ENDING CHARACTER

This is useful when you want keep an ending character, but don't actually want the ending character to be shown on the screen. 

For example: 

:o:ar::aristocrat

Typing "ar" followed by the spacebar will produce "aristocrat" with no trailing space, which allows you to make the word plural or possessive without having to press Backspace.

( ) = LARGE AMOUNT OF REPLACEMENT TEXT

Hotstrings that also produce a large amount of replacement text by using continuation characters ( )

The first round(curved) bracket(parentheses) must be entered directly below the hotstring, and the ending curved bracket must be entered under the replacement text

For example:

::text1::

(

Any text between the top and bottom parentheses is treated literally, including commas and percent signs.


By default, the hard carriage return (Enter) between the previous line and this one is also preserved.

    By default, the indentation (tab) to the left of this line is preserved.

)


Both brackets(parentheses) must sit as the left most characters on each line in the "SavedText.txt" file, exactly as shown above.

Note: You may also include the special character t which is text mode. This may make it slightly faster, as it will enter it as raw text rather than trying to translate each character to a keystroke. :t:text1::

Application Window Specific

You may also assign a hotstring to only work in a specific application.

To only allow the hotstring :c:TATT::tired all the time to work within Vision 3 Con Mgr, you can define the application using #ifWinActive, [WindowsTitle], [WindowText]

For example:

#ifWinActive, ,Consultation Manager

:c:TATT::tired all the time

#ifWinActive


The last #ifWinActive switches this back off, so that any remaining hotstrings below it are ignored by the application.


Some applications may also require the windows title to be set as "containing the word", rather that the default "must start with". Therefore, use SetTitleMatchMode as 2, written in the following way:

SetTitleMatchMode, 2

#ifWinActive, ,Consultation Manager

:c:TATT::tired all the time

#ifWinActive


si = Send keystrokes in a Hotstring

This special character isn't usually required as it works as part of the default in this application, but I have included for consistency.

A hotstring can also be set to use keystrokes (keyboard keys) to activate menus and shortkeys within an application.


For example, within Vision 3 Con Mgr you can press ALT+A to open the Add menu, and then press an underlined character within the menu to jump to that place in the menu. Therefore, press ALT+AH would open the Height entity

To turn this into a hotstring command you can do this :si*:1Ht::{alt}ah

To make sure it is only triggered within Vision 3 Con Mgr, you would enter it like this:


SetTitleMatchMode, 2

#IfWinActive, ,Consultation Manager

:si*:1Ht::{alt}ah

#IfWinActive


To include multiple hotstrings in this format that should only work within Vision 3 Con Mgr keep them within the two #IfWinActive tags, like this:

SetTitleMatchMode, 2

#IfWinActive, ,Consultation Manager

:si*:1Hx::{alt}ah                                       ;Height

:si*:1Mr::{alt}a{down 18}{enter}                ;Medication Review

:si*:1Ad::{alt}a{down 15}{enter}!gt!n                ;Therapy Advice

:si*:1Asp::!a{down 4}{enter}aspirin tab 75{enter}{tab} ;Acute Script

#IfWinActive


Note: the use of the semi-colon ; which will ignore any text after it. This is used for reference information as in the above example, so that you know what each hotstring does.

#Hotstring = SECTION RULES

Hotstrings rules can be applied to a whole section rather than adding then to each and every hotstring. It is positional and will affect all replacement code(s) below it within the SavedText.txt file.


This means that instead of making each replacement code case sensitive (using :c:) you can simply make them all standard codes (i.e. ::btw::by the way) and enter #Hotstring c as the directive that will affect all the codes below.


Taking the example in the last section above, the * asterisk which will remove the need to enter an ending character could be entered like this to apply to all the hotstrings:

#Hotstring *

SetTitleMatchMode, 2

#IfWinActive, ,Consultation Manager

::1Hx::{alt}ah                                       ;Height

::1Mr::{alt}a{down 18}{enter}                ;Medication Review

::1Ad::{alt}a{down 15}{enter}!gt!n                ;Therapy Advice

::1Asp::!a{down 4}{enter}aspirin tab 75{enter}{tab} ;Acute Script

#IfWinActive

#Hotstring *0


You can use a zero after the #Hotstring *0 or c0 or b0 to turn off the hotstring section rule(s). For example, in this case *0 will mean that an end character will now be in effect.

You may also add more than one special character but enter a space between them, i.e. #Hotstring * c


Note that you can still add other special characters to any of the hotstring within the section if you want to add a specific rule to a particular hotstring. This can even include switching off the section rule.

For example adding *0 to the hotstring in the above section example will mean that an end character would be needed to activate it

:*0:1Hx::{alt}ah   

Alternative Ending Characters

Alternative Ending Characters can be defined globally but note that this will apply to all the hotstrings in the "SavedText.txt" file.

Specify the word EndChars after #Hotstring followed by a single space character and then the new ending characters, as in the following example:

#Hotstring EndChars `n `t


This would mean that the only ending characters for the entire SavedText.txt file would be Enter, Space and Tab

Share by: