Creating mailing list from email addresses in different notes

(Tilmann Altenberg) #1

I want to create a mailing list for a subset of individuals by extracting their email addresses from notes collected by an agent. There is a note for each individual concerned containing (among other things) the attribute “Email”. Could anyone suggest how this can be accomplished?

(James Fallows) #2

The details would of course vary with specifics of your system. But a simple overall approach to get started could be:

  • Have items with the relevant attributes you want, let’s say $RecipientName and $RecipientAddress.
  • Have another note whose purpose is to collect a list of the email addresses.
  • For that other, collector note, have a Rule that says something like:
    $Text=collect(children,$RecipientAddress).format("\n") [If the collector note is the parent container of the notes with the names and addresses] or
    $Text=collect(children(“AddressList”),$RecipientAddress).format("\n") [if the collector note is drawing addresses from some other set of notes, in this case notes within the “AddressList” container.

Formulas like this will give you a list of email addresses, separated by line breaks. Eg:

You can do this in more elaborate fashions, with lists containing other attribute values too – or via HTML export. Will let others lay out those details. But the collect operator will get you started. Details on collect are in aTbRef: “

(Paul Walters) #3

If you have names in Apple Contacts, you can add those names to a Group, and then use that Group in Apple Mail to send the message.

To import names to Contracts you need a CSV file laid out similar to

Last Name,First Name,e-Mail Address

In Contacts you use File > Import, select the CSV, use the dialog that will appear to map your CSV to Contacts fields.

Then you need to make a group.

There is a thread in this forum that explains how to make a CSV file. No time to find it just now, but search will reveal it for you.

(Mark Anderson) #4

Fleshing out @JFallows’ answer a bit…

Email RFCs are a bit opaque to read but your list should comprise comma-delimited (comma, no spaces or line breaks) emails addresses in either of these forms:

  • Jane Doe<>

Thus as a mailing a list this might look like:,Jane Doe<>

I’ll assume you are storing email addresses in $Email (e.g., and that the name to be used in the first part of the longer form above in $FullName (e.g. Jane Doe). I’ll assume all the notes with such data use the ‘Person’ prototype and that we’ve added a String type user attribute $EmailAddrString.

Now our agent uses this query:

$Prototype=="Person" (of course you can refine this query to find only people you want on the list)

The agent’s action is:


Lastly the agent’s rule is:


The text of your note is now a correctly formatted string you can copy to your email ‘to’ field - or better the bcc field to keep recipients addresses hidden from each other. IOW , your agent $text will look like this:,Jane Doe<>

Note: the use of a comma only between each address and no line breaks in the list as per the RFCs.

(James Fallows) #5

I realize that the initial response I gave was to the question I (on quick glance) thought you were asking (about developing a mailing list from a set of attributes you’d already assigned), rather than what you were actually asking, about extracting values. Thanks to @mwra and @PaulWalters for instructive answers to your actual question, which are informative for many of us.