< Usage Preferences >

Serial Mail Help Book

Template format

The template is a standard email message, which has to be located in your Drafts folder. The script will replace the following strings with their corresponding Address Book entries for each recipient in the selected Address Book group respectively:

Syntax

Tags follow the following (XML compliant) syntax.

Placeholders for information form the adress book

<ab:tagname label="label attribute" number="optional item number" default="optional default value"/>

where tagname is one of the tags listed below

Placeholder for attachments

<finder:file name="path/filename"/>

Examples

Examples for such tags are

<ab:first_name/>
Will be replaced by the persons first name or an empty string if the first name is not available.
<ab:first_name default="Not available."/>
Will be replaced by the persons first name or the string "Not available." (without the quotation signs) if the first name is not available.
<ab:email label="work" default="No work email given."/>
Will be replaced by the persons email address corresponding to the "Work" label (the first address, if there are may) or the string "No work email given." (without the quotation signs) if this entry does not exist in the persons Address Book card.
<ab:email label="work" number="2" default="No second work email given."/>
Will be replaced by the persons second email address corresponding to the "Work" label or the string "No second work email given." (without the quotation signs) if this entry does not exist in the persons Address Book card.
<finder:file name="/Users/fries/Pictures/flower.jpg"/>
Will insert the attachment (here a picture) "flower.jpg" located at /Users/fries/Pictures/flower.jpg" at the respective place.

Supported Placeholders for Address Book information

Tag Address Book value inserted Label attribute Number attribute Default value
ab:first_name First name. No No Optional
ab:last_name Last name. No No Optional
ab:title Prefix No No Optional
ab:suffix Suffix No No Optional
ab:phone Phone number. Optional Optional Optional
ab:email Email address. Optional Optional Optional
ab:note Note. No No Optional
ab:address.street Street of Address. Optional Optional Optional
ab:address.state State of Address. Optional Optional Optional
ab:address.zip ZIP of Address. Optional Optional Optional
ab:address.city City of Address. Optional Optional Optional
ab:address.country Country of Address. Optional Optional Optional
ab:address.country.code Country Code of Address. Optional Optional Optional
ab:custom Value of the custom field (aka related names) with "my_label" as label. Required Optional Optional
ab:middle_name Middle Name No No Optional
ab:organization Organization No No Optional
ab:department Department No No Optional
ab:job_title Job Title No No Optional
ab:birth_date Birth Date No No Optional
ab:birth_date.day Day of Birth Date No No Optional
ab:birth_date.month Month of Birth Date No No Optional
ab:birth_date.year Year of Birth Date No No Optional
ab:aim AIM Username No No Optional
ab:icq ICQ Username No No Optional
ab:msn MSN Username No No Optional
ab:url URL Optional Optional Optional
ab:home_page Home Page No No Optional
ab:nickname Nickname No No Optional

Attributes

An address book tag may have any of the three attributes label, number and default. The label and the number attribute let you select items from entries which are not unique for a person. For example you may have 3 home email addresses and 2 work email addresses. The default attribute allows you to specify a default value which is taken in case the selected address book entry is empty.

Labele Attribute

You may use any label supported by the Mac OS X Address Book. Note hat the label as you see it in Address Book might be different from the label you have to use to access the entry, e.g. because your System is set to a non-english language.

Label Address Book value Applies to
work Work phone, email, address
home Home phone, email, address
mobile Mobile phone number phone

Inserting Attachments using a Placeholder

Tag Result Name attribute Default value
finder:file Insert an attachment consisting of the file specified by the name attribute Required No
The path name provided to the tag finder:file can be parametrized with the recipient name. This allows to add an individual attachment specific to the recipient of the generated email. The path name may contain one or two placeholders defined by the two characters %@. The first occurrence of %@ is replaced with the first name of the recipient. The second occurrence is replaced with the last name of the recipient.

Example

If the template contains the tag <finder:file name="/Users/fries/Desktop/Results-%@-%@.pdf"/> then the email generated for the recipient John Doe will have the file "/Users/fries/Desktop/Results-John-Doe.pdf" in place of placeholder.

Remarks

If the corresponding Address Book entry for email is empty, no message will be generated for this person.

Note that the <ab:custom label="my_label"/> tag makes the script very powerful and versatile. You may specify your own labels in the "related names" section of the persons Address Book entry (e.g. "Assistant", "Customer number") and the script will replace the corresponding tags (e.g. <ab:custom label="Assistant"/>, <ab:custom label="Customer number"/>) by the corresponding Address Book values.