Full alphabetic list of macros

Top  Previous  Next

Return to the main macros page.

 

Note: Every macro must be preceded by the percentage symbol %.

Note: Some macros require a parameter, which is appended. Example: %ATTACHFILE="C:\My Files\invoice.txt" attaches the file defined in the parameter. For some macros a parameter is optional; parameters can be other macros, any kind of text, e-mail addresses, templates etc.

Note: The macros work on the current message only; that is, any configurational macros do supersede program-wide settings only for the message they are used for!

 

 

-

Use it at the end of a line to forego unwanted line breaks in your messages.

Without this every line in your template creates a new (perhaps empty) line in your message.

_name="value"

Sets variables.

The variable name can contain letters, integers and the underscore.

 

Variables are useful for inserting the same text (e.g.: result of some calculation or Regular Expression) into various places in your message. They also help you to save results of macros temporarily.

 

Note: This is the same as the %VARname macro.

ABnnnPPP

Inserts a field from the address book.

"nnn" determines the address used, "PPP" is the address book field to be used.

 

Values for nnn:

 

TO        Address Book entry for the TO header (current message)

FROM        Address Book entry for the FROM header (current message)

REPLY        Address Book entry for the REPLY-TO header (current message)

OTO        Address Book entry for the TO header (original message)

OFROM        Address Book entry for the FROM header  (original message)

OREPLY        Address Book entry for the REPLY-TO header  (original message)

 

 

Values for PPP:

 

Name        full name

FirstName        first name

LastName        last name

MiddleName        middle name

Handle        handle

NamePrefix        name prefix

NameSuffix        name suffix

Birthday        date of birth

e-mail        primary e-mail address

Addr        private street address

City        private city name

State        private state/province

ZIP        private ZIP/Postal code

Country        private country

Phone        private phone number

Fax        private fax number

Mobile        mobile phone number

Page        private homepage URL

Company        company name

Job        job title

Dept        department name

Office        office number

BusAddr        business street address

BusCity        business city name

BusState        business state/province

BusZIP        business ZIP/Postal code

BusCountry        business country

BusPhone        business phone number

BusFax        business fax number

BusPager        business pager number

BusPage        business homepage URL

Gender        person's gender

Charset        character set (for this Address Book entry)

Memo        Memo contents

 

Note: You can set a parameter to insert if no corresponding value for the field you defined is found. The parameter can be another macro, like %TONAME.

ACCOUNT="Name"

Defines the active account.

Regardless of the account you have selected in the account's pane, a message based upon a template with this macro will always use the account specified here.

ACCOUNTATTACHDIR

The full path to the account's attachment directory.

This macro is useful when used in the parameter of %ATTACHFILE, %INCLUDE and %PUT

ACCOUNTDIR

The full path to the account's home directory.

This macro is useful when used in the parameter of %ATTACHFILE, %INCLUDE and %PUT

ACCOUNTNAME

Inserts the name of the active account for reference purposes.

ADDHEADER(header, text)

Adds text to the message header.

The header parameter must be the RFC-name as defined in Options->Preferences->Message Headers.

ATTACHFILE="filepath"

Attaches a file determined by the filepath.

Very usefuly if you regularly send out the same file, e.g. OpenPGP keys.

ATTACHMENTS

Inserts the list of the files attached to the current message.

Only works if files were attached before this macro gets executed.

ATTACHVCARD

Attaches your vCard as defined in Account->Properties->General->Edit personal vCard.

AUTOPGPMIME

Sets the PGP/MIME option to auto for the message created by the template.

BCC=""

Removes all recipients from the BCC field.

BCC="addresses"

Adds recipients to the BCC field.

BCCLIST or  BCC

Inserts the full list of recipients into the BCC address field

BLANK

Creates a blank template.

Usually an empty template will be replaced by the default (account) templates; this macro prevents that.

CALCULATE="expression" or CALC="expression"

Calculates mathematical expressions.

 

Operators:

 

+ (addition)

- (subtraction)

* (multiplication)

/ (division)

\ (remainder of integer division, modulo)

** (power function)

 

< (smaller than)

> (greater than)

== (is exactly equal to)

<= (smaller than or equal to)

>= (greater than or equal to)

 

& (AND)

| (OR)

^ (XOR)

~ (NOT)

 

&& (logical AND)

|| (logical OR)

^^ (logical XOR)

! (logical NOT)

 

?: (ternary operator: {exp0}?{exp1}:{exp2} gives exp1 for exp0 != 0, and exp2 for exp0 = 0).

 

Note: Numbers have to be in strict form; the decimal point is a dot; no thousands separator.

 

Particularly useful with Regular Expression - i.e. to calculate over numbers of a message you received (like eBay sales notices).

CAPITAL="text"

Converts text to capitalised first letter for every word in the string defined.

Parameter can be another macro, i.e. %FROMNAME.

CAPITALFIRST="text" or UCFIRST="text"

Converts text to capitalised first character of the first word.

Parameter can be another macro, i.e. %FROMNAME.

CC=""

Remove all recipients from the CC field.

CC="addresses"

Add recipients to the CC field.

CCLIST or CC

Inserts the full list of recipients into the CC field.

CHARSET="Charset ID"

Defines the chararacter set for a message.

Character set IDs follow Options->XLAT Tables.

CLEAR

Clears all previously entered/generated text.

Only for Quick Templates.

CLIPBOARD

Insert text from the clipboard.

COMMENT

Insert the comment from the RFC-822 header into the message body.

COMMENT="text"

Add RFC-822 header containing the string defined in the parameter to a message.

COOKIE

Insert a random cookie from the current account's cookies.

 

Use the path to an external text file as a parameter if you want to insert a cookie from outside The Bat! (i.e. %COOKIE="c:\Programs\Bat\my cookies.txt").

CURSOR

Places the cursor in the message editor at the position defined by this macro.

Use BODY or TEXT for the message's body, or use an RFC-header name for the respective header (e.g. %CURSOR="FROM" puts the cursor in the From field).

The header field must be the RFC-name as defined in Options->Preferences->Message Headers.

DATE

Insert the current date in the long date format defined in your system's country settings.

You can define your own format by setting a parameter; see Formatting Date and Time.

 

Example: %DATE="yy-m-d" gives 09-08-10 on August, 10th 2009.

DATEEN

Inserts the current date in the format day-of-week, month day, year: Wednesday, August 10, 2005

DATESHORT

Insert the current date in the short date format as defined by your system's country settings.

DOW

Insert the current day of week.

ENCRYPTCOMPLETE

Automatically encrypt the current message when it is completed.

FOLDERFROMADDR

Inserts the FROM address of the current folder's Identity properties.

FOLDERFROMNAME

Insert the FROM name of the current folder's Identity properties.

FOLDERNAME

Insert the name of the current folder.

Particularly useful for Save/Print templates.

FOLDERORGANISATION, FOLDERORGANIZATION

Insert the Organisation name from the current folder's Identity properties.

FOLDERREPLYADDR

Insert the REPLY-TO address from the current folder's Identity properties.

FOLDERREPLYNAME

Insert the REPLY-TO name from the current folder's Identity properties.

FROM="address"

Change the default FROM field contents to the address defined in the parameter.

FROMADDR

Inserts the address of the sender.

FROMFNAME

Inserts the first name of the sender.

FROMLNAME

Inserts the last name of the sender.

FROMNAME

Inserts the full name of the sender.

FULLSUBJ, FULLSUBJECT

Inserts the full subject of the message.

 

Note: Includes any Re: and Re[n]: prefixes for replied messages.

HDRheader

Inserts the text from the current message header field identified by the header parameter.

The header parameter is the RFC-name of the header defined in Options->Preferences->Message Headers.

 

Note: The header part must not contain special characters!

HDRheader="text"

Add text to the message header.

The header parameter must be the RFC-name as defined in Options->Preferences->Message Headers.

 

Note: The header part must not contain special characters!

HEADER(header)

Inserts the text from the current message header field identified by the header parameter.

The header parameter is the RFC-name of the header defined in Options->Preferences->Message Headers.

HEADERS

Inserts the RFC-822 headers of the original message.

IF : "var1" <comparison operator> "var2" : <true> : <false>

Conditional text insertion:

If <var1> is = or > or < or <> (unequal) <var2>, then use the <true> result. If the comparison fails, use the <false> result.

 

Operators:

= (is equal to)

> (greater than)

< (smaller than)

<> (is not equal)

 

Example:

%IF:"%TIME"<"12:00":"morning":%-"%IF:'%TIME'>'17:00':'evening':'afternoon'"

 

Note: Any of the variables (<var1>, <var2>, <true>, <false>) can be macros or text strings; macros can be used recursively.

Note: <var1> and <var2> are compared case insensitive.

IFCASE : "var1" <comparison operator> "var2" : <true> : <false>

Same as the IF macro, but case sensitive.

IFN : "nvar1" <comparison operator> "nvar2" : <true> : <false>

Same as the IF macro, but numeric.

 

Note: If a parameter cannot be converted to a number, its value is declared zero.

Note: Numbers use strict form - no thousands separator, the decimal point is a dot.

INCLUDE="filepath"

Inserts text from an external file determined by "filepath".

INSERTPGPKEY="address"        

Inserts the OpenPGP key for the given address from the public key ring.

 

Note: This feature works only with The Bat!'s the internal OpenPGP implementation.

ISSIGNATURE

Replaces everything after the signature delimiter by text generated by the Quick Template containing this macro.

If no signature delimiter is detected, the macro adds one followed by the generated text.

 

Note: Only used in Quick Templates.

LANGUAGE="Language ID"

Sets the default spell checker.

 

Language IDs:

 

       AM - American English        

       EA - Australian English        

       BR - British English        

       CT - Catalan        

       CZ - Czech        

       DA - Danish        

       FI - Finnish        

       FR - French        

       FC - French Canadian

       GN - German (new spelling)

       GO - German (old spelling)

       IT - Italian        

       NO - Norwegian (Bokmal)        

       NN - Norwegian (Nynorsk)        

       NL - Dutch        

       PB - Portuguese (Brazil)        

       PT - Portuguese (Iberian)        

       PL - Polish        

       SP - Spanish        

       SW - Swedish        

       RU - Russian        

       HU - Hungarian        

 

Prefix the ID with CSAPI to use respective dictionaries for the language if they are installed.

 

Note: CSAPI is only supported until those dictionaries installed with Oficce 97 or one of its component applications!

LOWER="text"

Converts text to lower case.

 

Note: The parameter can be another macro (e.g. %FROM)

MAILDIR

The full path to the program's mail directory.

This macro is useful when used as the parameter of %ATTACHFILE, %INCLUDE or %PUT.

MODIFYONCE(header1, header2, ... )

If you apply a template (automatically) more than once, the body of a created message may appear unchanging while headers could be changed. To preserve values of headers use this macro in your template.

 

Note: This macro should be inserted/used before any header modification are made.

MSGID

Inserts a message's ID as defined in the RFC-header Message ID.

 

Note: It does not work for new messages, since thy don't have a message ID, yet.

NOENCRYPTCOMPLETE

Disables automatic encryption of a message.

NOPGPMIME or CLEARSIGN

Disables PGP/MIME.

NORCPTCONFIRM, NORRQ

Disable the Receipt Request flag.

NOREADCONFIRM, NORCR

Disablee the Reading Confirmation Request flag.

NOSIGNCOMPLETE

Disables automatic signing of a message.

NOSPLIT

Disable automatic splitting of the message if you have set The Bat! to split large messages under Files & Directories in the account properties).

NOUSEPGP

Disable OpenPGP for a message.

NOUSESMIME

Disable S/MIME for a message.

NOWRAPJUSTIFY

For lines wrapped with %WRAPPED no justification is performed.

 

Note: Used only together with %WRAPPED.

OATTACHMENTS

Inserts a list of files attached to the original message.

 

Note: Replies and Forwards only.

OBCCLIST, OBCC

Inserts the full list of recipient of the original message into the BCC field.

 

Note: Replies and Forwards only.

OCCLIST, OCC

Inserts the full list of recipient of the original message into the CC address field.

 

Note: Replies and Forwards only.

OCHARSET

Inserts the original message's character set.

 

Note: Replies and Forwards only.

OCOMMENT

Inserts the text of the Comment header field from the original message.

 

Note: Replies and Forwards only.

ODATE

Inserts the date of the original message in long date format defined by your system's country settings.

You can define your own format by setting a parameter; see Formatting Date and Time.

 

Example: %ODATE="yy-m-d" gives 09-08-10 on August, 10th 2009.

 

Note: Replies and Forwards only.

ODATEEN

Inserts the original message's date in the format day-of-week, month day, year: Wednesday, August 10, 2005.

 

Note: Replies and Forwards only.

ODATESHORT

Inserts the original message's date in the short date format as defined by your system's country settings.

 

Note: Replies and Forwards only.

ODOW

Inserts the original message's day of week.

 

Note: Replies and Forwards only.

OFROMADDR

Inserts the original message's address of the sender.

 

Note: Replies and Forwards only.

OFROMFNAME

Inserts the original message's first name of the sender.

 

Note: Replies and Forwards only.

OFROMLNAME

Inserts the original message's last name of the sender.

 

Note: Replies and Forwards only.

OFROMNAME

Inserts the original message's full name of the sender.

 

Note: Replies and Forwards only.

OFULLSUBJ, OFULLSUBJECT

Inserts the original message's full subject.

 

Note: Includes any Re: and Re[n]: prefixes.

Note: Replies and Forwards only.

OHEADER="text"

Inserts the original message's header defined in the parameter.

The header parameter must be the RFC-name as defined in Options->Preferences->Message Headers.

 

Note: Replies and Forwards only.

OMSGID

Inserts the original message's ID.

 

Note: Replies and Forwards only.

OORGANIZATION, OORGANISATION

Inserts the original message's Organisation header value.

 

Note: Replies and Forwards only.

ORCVDATE

Inserts the original message's received date.

You can define your own format by setting a parameter; see Formatting Date and Time.

Example: %DATE="yy-m-d" gives 09-08-10 on August, 10th 2009.

 

Note: Replies and Forwards only.

ORCVDATEEN

Inserts the original message's received date in the format day-of-week, month day, year: Wednesday, August 10, 2005.

 

Note: Replies and Forwards only.

ORCVDATESHORT

Inserts the original message's received date in the short date format as defined by your system's country settings.

 

Note: Replies and Forwards only.

ORCVDOW

Inserts the original message's received date's day of the week.

 

Note: Replies and Forwards only.

ORCVTIME

Inserts the original message's received time.

You can define your own format by setting a parameter; see Formatting Date and Time.

 

Note: Replies and Forwards only.

ORCVTIMELONG

Inserts the original message's received time in long format as defined by your system's settings.

 

Note: Replies and Forwards only.

ORCVTIMELONGEN

Inserts the original message's received time in hour:minutes:seconds AM/PM format: 11:16:53 AM.

 

Note: Replies and Forwards only.

OREPLYADDR

Inserts the original message's Reply-To address.

 

Note: Replies and Forwards only.

OREPLYCOUNTER, ORECOUNT

Inserts the original message's reply counter prefix.

 

Note: Replies and Forwards only.

OREPLYFNAME

Inserts the original message's first name as defined in its Reply-To header.

 

Note: Replies and Forwards only.

OREPLYLNAME

Inserts the original message's last name as defined in its Reply-To header.

 

Note: Replies and Forwards only.

OREPLYNAME

Inserts the original message's name as defined in its Reply-To header.

 

Note: Replies and Forwards only.

ORETURNPATH

Inserts the original message's return address as defined in its Return-Path header.

 

Note: Replies and Forwards only.

ORG="text"

Sets the value for the current messages Organisation header.

 

Note: This supersedes the default you set in Account->Properties->General.

ORGANIZATION, ORGANISATION

Inserts the name of the organisation you defined in Account->Properties->General

OSUBJ

Inserts the original message's subject line without any prefixes.

 

Note: Replies and Forwards only.

OTEXT

Inserts the entire text of the original message.

 

Note: Replies and Forwards only.

OTEXTSIZE

Inserts the size of the original message in bytes.

 

Note: Replies and Forwards only.

OTIME

Inserts the original message's time.

You can define your own format by setting a parameter; see Formatting Date and Time.

 

Note: Replies and Forwards only.

OTIMELONG

Inserts the original message's received time in long format as defined by your system's settings.

 

Note: Replies and Forwards only.

OTIMELONGEN

Inserts the original message's received time in hour:minutes:seconds AM/PM format: 11:16:53 AM.

 

Note: Replies and Forwards only.

OTOADDR

Inserts the original message's address as shown in its To header.

 

Note: Replies and Forwards only.

OTOFNAME

Inserts the original message's first name shown in its To header.

 

Note: Replies and Forwards only.

OTOLIST, OTO

Inserts the original message's addressee as shown in its To header.

 

Note: Replies and Forwards only.

OTOLNAME

Inserts the original message's last name as shown in its To header.

 

Note: Replies and Forwards only.

OTONAME

Inserts the original message's name as shown in the To header.

 

Note: Replies and Forwards only.

PAGENUMBER

Adds page numbers when printing messages.

 

Note: In Save/Print templates.

PGPMIME

Enables PGP/MIME for the current message.

PRIORITY="H/N/L"

Sets the message priority:

 

H = High

N = Normal

L = Low

PROGRAMDIR

Defines the full path to the program directory. This macro is useful when used as part of the parameter for the %ATTACHFILE, %INCLUDE or %PUT macro.

PUT="filepath"

Inserts text from a file indicated by the parameter.

QHEADERS

Inserts the RFC-822 headers of the original message as quoted text.

 

Note: Replies and Forwards only.

QINCLUDE="Handle"

Inserts text generated by a Quick Template.

 

Note: The parameter has to be the exact handle (name) you defined in the Quick Template editor.

QT="Handle"

Same as %QINCLUDE.

QUOTECLIPBOARD, QCLIPBOARD

Inserts the text from the clipboard as quoted text.

QUOTES

Inserts the original message's text with quote prefix.

You can also pre-define a text by using a parameter.

 

Note: Replies and Forwards only.

QUOTESTYLE="expression"

Specifies a quotation prefix to be used.

 

Possible values:

 

NONE - empty prefix

I - initials of the original message's sender (default)        

IF - first initial of the original message's sender

N - full name of the original message's sender

F - first name of the original message's sender

L - last name of the original message's sender

 

You can also define an arbitrary text string alone or in conjunction with any of the above.

 

Note: Replies and Forwards only.

RCPTCONFIRM

Sets the Receipt Request flag.

READCONFIRM

Sets the Reading Confirmation Request flag.

REGEXPBLINDMATCH="giventext"

Extracts the text given by %SUBPATT.

REGEXPMATCH="giventext "

Inserts a text given by a search with %SETPATTREGEXP.

REGEXPQUOTES="regexp"

Inserts a text given by a search using Regular Expressions as quotes.

REGEXPTEXT="regexp"

Insert a text given by a search using Regular Expressions using the text of the original message.

REM="comment"

Add comments to templates.

 

Note: These comments are not used ina resulting message. They only help you to stay organised with complex templates.

REPLYADDR

Inserts the address of the reply recipient.

REPLYCOUNTER, RECOUNT

Inserts the reply counter of the current message.

Example:

%SUBJECT="%RECOUNT Why don't we change the subject?"

 

Note: Replies and Forwards only.

REPLYFNAME

Inserts the first name of the reply recipient.

 

Note: Replies and Forwards only.

REPLYLNAME

Inserts the last name of the reply recipient.

 

Note: Replies and Forwards only.

REPLYNAME

Inserts the full name of the reply recipient.

 

Note: Replies and Forwards only.

REPLYTO="address"

Replaces the default REPLY-TO contents with the address specified in the parameter.

 

Note: Replies and Forwards only.

RETURNPATH="address"

Replaces the default RETURN-PATH contents with the address specified in the parameter.

 

Note: Replies and Forwards only.

SETEDITOR="n"

Sets the current editor mode

 

Possible values for n:

 

1 - Plain text Microed

2 - Plain text Windows editor

3 - HTML / Plain

4 - HTML only

 

SETHEADER("header", "text")

Replaces the content (if any) of tht message header field identified by the "header" parameter with the text specified in the "text" parameter.

 

Note: The header parameter has to be the RFC-name as defined in Options->Preferences->Message Headers.

SETPATTREGEXP="regexp"

Defines a search pattern using Regular Expression.

 

Note: The result of the search will be used with other macros, e.g. %REGEXPMATCH.

SIGNCOMPLETE

Automatically signs a message using PGP or S/MIME.

 

Note: Useful if only very few of your contacts require electronically signed messages.

SINGLELINE, ONELINE

If the result of another macro (i.e. one using Regular Expressions) is longer than the defined line length (usually 70 characters) this macro will make the text output in one line.

 

Note: Useful for changes to header fields (like adding multiple addresses to the BCC header).

Note: In Quick Templates only.

SINGLERE

Disables the reply counter.

 

Note: This macro is largely superseded by the option "Use reply numbering in the subject line" in Account Properties->Templates->Reply. You can still use it for recipients (like mailing lists) that cannot handle reply counters, if you want to have a reply counter as default.

SPLIT

Splits an outbound message if it exceeds the size specified in Account Properties->Files and Directories.

SUBJ

Inserts the subject of a message without prefixes.

SUBJECT="text"

Sets a new subject for the message.

SUBPATT="n"

Inserts the number of substrings set by the REGEXPMATCH or REGEXPBLINDMATCH macros.

 

%SUBPATT='0' returns the text matching the entire Regular Expression, "1" gives the first matching subpattern, "2" the second etc.

TEXT

Inserts the text of the original message.

 

Note: Replies and Forwards only.

TEXT="nn"

Inserts the first lines of the text defined by the parameter. The value for the parameter has to be an integer.

 

Note: Replies and Forwards only.

TEXT="nn L"

Inserts the first lines of the text defined by "nn" and a URL.

"nn" has to be an integer.

 

Note: Replies and Forwards only.

THEBATSERIALNUMBER        

Inserts the serial number of your installed version of The Bat!.

THEBATVERSION

Inserts the version number of your installation of The Bat!.

TIME

Inserts the current time in the short time format (defined by your system's country settings).

 

Note: You can define another format by using it as a parameter.

TIMELONG

Inserts the current time in the long time format (defined by your system's country settings).

TIMELONGEN

Inserts the current time in "hour:minutes:seconds AM/PM" format.

TO="address(es)"

Changes the TO header to the value given by the parameter. If left empty it will remove all addresses already in the header.

 

Beware: Use valid e-mail addresses only!

TOADDR

Inserts the first TO e-mail address.

TOFNAME

Inserts the first name of the first TO addressee.

TOLIST

Inserts the full list of recipienta in the TO header.

TOLNAME

Inserts the last name of the first TO addressee.

TONAME

Inserts the full name of the first TO addressee.

TOTALPAGES

Adds the total number of pages when printing messages.

 

Note: In Save/Print templates only.

TRACKINGNUMBER        

Inserts a random hexadecimal  32-bit number.

 

Useful for support correspondence or orders. If inserted into the Subject header you can easily filter on it.

UPPER="text"

Convert text to upper case.

 

You can define an arbitrary text string or a macro to generate text as the parameter.

USEPGP

Enables OpenPGP for encryption/signing.

USESMIME

Enables S/MIME for encryption/signing.

VARname="value"

Sets variables.

The variable name can contain letters, integers and the underscore.

 

Variables are useful for inserting the same text (e.g.: result of some calculation or Regular Expression) into various places in your message. They also help you to save results of macros temporarily.

 

Note: This is the same as the %_name macro.

WINDOWSBUILDNUMBER

Inserts your Windows version build number.

WINDOWSCSDVERSION

Inserts additional version information of your Windows installation.

WINDOWSMAJORVERSION

Inserts the major version number of your Windows.

WINDOWSMINORVERSION

Inserts the minor version number of your Windows.

WINDOWSPLATFORMNAME

Inserts your Windows platform name (e.g. Windows 95, Windows NT).

WRAPJUSTIFY

Justifies the text given by the %WRAPPED macro left and right.

WRAPPED

Wraps inserted text to the line length specified in Options->Preferences->Editor->Editor Preferences.

 

The parameter can be any text string, a macro or text from an external file. For best effect, place the %WRAPPED macro at the beginning of a new line

 

This is very helpful in conjunction with the COOKIE macro to wrap longer quotations from an external file.

 

You can define a precise line length limit by using the (limit, "text") syntax, where the first parameter defines the character after which to insert a line break.

Return to the main macros page.