Accelerators syntax

The accelerators template syntax is pretty easy. Just type the text you want to insert when call the accelerator. To insert some dynamic content you have to add the tags into the template. The tags are enclosed into the double braces {{tag}}. Text Accelerator shows the autocomplete popup window to help you type the tags.

The default tags are:

  • sel - inserts the text you've selected before calling the accelerator
  • clp - inserts the text you have in the clipboard

Examples:

[b]{{sel}}[/b] - the result of this accelerator is the selected text with BB Code tags bold.
[url={{clp}}]{{sel}}[/url] -  this accelerator creates the BB Code url. Url must be copied into the clipboard before calling accelerator.

As you see, it is possible to use any number of tags in the template text.

Modifiers

Modifiers are the scripts that modify the tags text. To apply the modifier type a colon (:) after the tag name:

{{sel:lcase}} - this accelerator modify the selected text (sel tag) with the lcase modifier (make text lowercase).

You can apply some modifiers one by one, just separate the modifiers by a colon (:)

{{sel:striptags:lcase}} - this accelerator strips the HTML tags from the selected text and make the text lowercase.

 The modifiers can have the parameters. Place the parameters in brackets. If the modifier has some parameters, separate the parameters with semicolon (;):

{{date:formatdate(1):ucase}} - this accelerator uses the date tag to insert the current date/time, then formatdate modifier with the parameter 1 format date/time as long date and then ucase make the formated date uppercase.

Modifiers can act as the tags with one parameters (ore more):

{{formatdate({{date}};1):ucase}} - this accelerator is same as {{date:formatdate(1):ucase}}.

Actually the tag is the modifier that doesn't accept the input text. Also, as you see, it is possible to use the nested tags.

Input and Output text

Most of modifiers accept the input text generated by modifiers chain and returns the processed text (ucase, lcase, etc.). Some modifiers don't accept the input text and just output the text for further processing (sel, clp, date, etc.). And some modifiers accept the input text, make some action with it and don't return the output. Example:

{{open(http://www.google.com/search?q={{sel:urlencode}}&ie=utf-8&oe=utf-8)}} - the modifier open opens the file or url (in this case it opens the google with the search text).