<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Poor man&#8217;s mail merge in Apple Mail</title>
	<atom:link href="http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/</link>
	<description>To boldly muse about Open Source</description>
	<lastBuildDate>Fri, 23 Jul 2010 14:18:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Sarah alawami</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-84043</link>
		<dc:creator>Sarah alawami</dc:creator>
		<pubDate>Sun, 14 Mar 2010 21:33:13 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-84043</guid>
		<description>I grabbed the script and pasted it int eh mail application folder where the mail scripts are stored. I chose my account but not sure what to do from there. any help would be appreciated. I&#039;d love to see this work.</description>
		<content:encoded><![CDATA[<p>I grabbed the script and pasted it int eh mail application folder where the mail scripts are stored. I chose my account but not sure what to do from there. any help would be appreciated. I&#8217;d love to see this work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scrivo a chi voglio con AppleScript &#171; Macworld Online</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-84009</link>
		<dc:creator>Scrivo a chi voglio con AppleScript &#171; Macworld Online</dc:creator>
		<pubDate>Tue, 26 Jan 2010 17:12:57 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-84009</guid>
		<description>[...] anche di pi&#249;. Gianugo ha pubblicato sul proprio blog la versione aggiornata dello script. Esercizio aggiuntivo: che cosa c&#8217;&#232; di pi&#249;, rispetto a quanto sopra?   var [...]</description>
		<content:encoded><![CDATA[<p>[...] anche di pi&#249;. Gianugo ha pubblicato sul proprio blog la versione aggiornata dello script. Esercizio aggiuntivo: che cosa c&#8217;&#232; di pi&#249;, rispetto a quanto sopra?   var [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham Kirby</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-83844</link>
		<dc:creator>Graham Kirby</dc:creator>
		<pubDate>Tue, 10 Nov 2009 23:09:16 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-83844</guid>
		<description>Sorry, problem with previous posting, probably with HTML encoding of angle brackets.

Intro should read:

If an entry in the address file has the format

firstname lastname &lt;emailaddress&gt;</description>
		<content:encoded><![CDATA[<p>Sorry, problem with previous posting, probably with HTML encoding of angle brackets.</p>
<p>Intro should read:</p>
<p>If an entry in the address file has the format</p>
<p>firstname lastname &lt;emailaddress&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graham Kirby</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-83843</link>
		<dc:creator>Graham Kirby</dc:creator>
		<pubDate>Tue, 10 Nov 2009 23:06:08 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-83843</guid>
		<description>Here&#039;s a tweaked version that allows you to select a signature to use, formats the message as plaintext, and does some simple personalisation.

If an entry in the address file has the format

firstname lastname 

then the message body will begin &quot;Dear firstname&quot;.

Graham

---------


(* Copyright 2008 Gianugo Rabellino - http://boldlyopen.com 
   This snippet is licensed under the Apache License version 2.0
   see http://www.apache.org/licenses/LICENSE-2.0.html *)

tell application &quot;Mail&quot; to set allAccounts to name of every account
choose from list allAccounts with title &quot;Choose the Mail account to use...&quot;
set theAccount to result as string

tell application &quot;Mail&quot; to set allSignatures to name of every signature
choose from list allSignatures with title &quot;Choose the signature to use...&quot;
set theSignatureName to result as string

set subjectDialog to display dialog ¬
	&quot;Enter the subject of the email to send&quot; default answer &quot;no subject&quot;
set theSubject to text returned of subjectDialog

set sendOrPreview to the button returned of ¬
	(display dialog ¬
		&quot;Send the messages right away or preview and send manually?&quot; with title ¬
		&quot;Send or Preview?&quot; with icon caution ¬
		buttons {&quot;Preview&quot;, &quot;Send&quot;} ¬
		default button 1)

set theText to (choose file with prompt &quot;Pick a text file containing the email text&quot;)

set messageBody to read theText

tell application &quot;Finder&quot;
	set addresses to paragraphs of ¬
		(read (choose file with prompt &quot;Pick a text file containing email addresses, one by line&quot;))
end tell

set AppleScript&#039;s text item delimiters to space

tell application &quot;Mail&quot;
	activate
	set activeAccount to account theAccount
	repeat with i from 1 to (the length of addresses)
		
		set target to item i of addresses
		set targetWords to every text item of target
		
		if (the length of targetWords) &gt; 1 then
			set forename to first word of target
			set theContent to &quot;Dear &quot; &amp; forename &amp; return &amp; return &amp; messageBody
		else
			set theContent to messageBody
		end if
		
		set newMessage to make new outgoing message ¬
			with properties {account:activeAccount, subject:theSubject, content:theContent}
		
		set message signature of newMessage to signature theSignatureName of application &quot;Mail&quot;
		
		tell newMessage
			set sender to ¬
				((full name of activeAccount &amp; &quot; &quot;)
			make new to recipient at end of to recipients ¬
				with properties {address:(a reference to target)}
			set visible to true
		end tell
		
		-- Set to plaintext
		-- From http://www.kith.org/journals/jed/2009/09/12/12380.html
		tell application &quot;System Events&quot;
			tell application process &quot;Mail&quot;
				set frontmost to true
			end tell
			keystroke &quot;T&quot; using {command down, shift down}
		end tell
		
		if sendOrPreview is equal to &quot;Send&quot; then
			send newMessage
		end if
	end repeat
end tell</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a tweaked version that allows you to select a signature to use, formats the message as plaintext, and does some simple personalisation.</p>
<p>If an entry in the address file has the format</p>
<p>firstname lastname </p>
<p>then the message body will begin &#8220;Dear firstname&#8221;.</p>
<p>Graham</p>
<p>&#8212;&#8212;&#8212;</p>
<p>(* Copyright 2008 Gianugo Rabellino &#8211; <a href="http://boldlyopen.com" rel="nofollow">http://boldlyopen.com</a><br />
   This snippet is licensed under the Apache License version 2.0<br />
   see <a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="nofollow">http://www.apache.org/licenses/LICENSE-2.0.html</a> *)</p>
<p>tell application &#8220;Mail&#8221; to set allAccounts to name of every account<br />
choose from list allAccounts with title &#8220;Choose the Mail account to use&#8230;&#8221;<br />
set theAccount to result as string</p>
<p>tell application &#8220;Mail&#8221; to set allSignatures to name of every signature<br />
choose from list allSignatures with title &#8220;Choose the signature to use&#8230;&#8221;<br />
set theSignatureName to result as string</p>
<p>set subjectDialog to display dialog ¬<br />
	&#8220;Enter the subject of the email to send&#8221; default answer &#8220;no subject&#8221;<br />
set theSubject to text returned of subjectDialog</p>
<p>set sendOrPreview to the button returned of ¬<br />
	(display dialog ¬<br />
		&#8220;Send the messages right away or preview and send manually?&#8221; with title ¬<br />
		&#8220;Send or Preview?&#8221; with icon caution ¬<br />
		buttons {&#8220;Preview&#8221;, &#8220;Send&#8221;} ¬<br />
		default button 1)</p>
<p>set theText to (choose file with prompt &#8220;Pick a text file containing the email text&#8221;)</p>
<p>set messageBody to read theText</p>
<p>tell application &#8220;Finder&#8221;<br />
	set addresses to paragraphs of ¬<br />
		(read (choose file with prompt &#8220;Pick a text file containing email addresses, one by line&#8221;))<br />
end tell</p>
<p>set AppleScript&#8217;s text item delimiters to space</p>
<p>tell application &#8220;Mail&#8221;<br />
	activate<br />
	set activeAccount to account theAccount<br />
	repeat with i from 1 to (the length of addresses)</p>
<p>		set target to item i of addresses<br />
		set targetWords to every text item of target</p>
<p>		if (the length of targetWords) &gt; 1 then<br />
			set forename to first word of target<br />
			set theContent to &#8220;Dear &#8221; &amp; forename &amp; return &amp; return &amp; messageBody<br />
		else<br />
			set theContent to messageBody<br />
		end if</p>
<p>		set newMessage to make new outgoing message ¬<br />
			with properties {account:activeAccount, subject:theSubject, content:theContent}</p>
<p>		set message signature of newMessage to signature theSignatureName of application &#8220;Mail&#8221;</p>
<p>		tell newMessage<br />
			set sender to ¬<br />
				((full name of activeAccount &amp; &#8221; &#8220;)<br />
			make new to recipient at end of to recipients ¬<br />
				with properties {address:(a reference to target)}<br />
			set visible to true<br />
		end tell</p>
<p>		&#8211; Set to plaintext<br />
		&#8211; From <a href="http://www.kith.org/journals/jed/2009/09/12/12380.html" rel="nofollow">http://www.kith.org/journals/jed/2009/09/12/12380.html</a><br />
		tell application &#8220;System Events&#8221;<br />
			tell application process &#8220;Mail&#8221;<br />
				set frontmost to true<br />
			end tell<br />
			keystroke &#8220;T&#8221; using {command down, shift down}<br />
		end tell</p>
<p>		if sendOrPreview is equal to &#8220;Send&#8221; then<br />
			send newMessage<br />
		end if<br />
	end repeat<br />
end tell</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Antoniotti</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-83683</link>
		<dc:creator>Marco Antoniotti</dc:creator>
		<pubDate>Wed, 15 Apr 2009 20:53:28 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-83683</guid>
		<description>Sei un genio.....</description>
		<content:encoded><![CDATA[<p>Sei un genio&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert patterson</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-83608</link>
		<dc:creator>Robert patterson</dc:creator>
		<pubDate>Tue, 27 Jan 2009 05:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-83608</guid>
		<description>Awesome work, any idea on how to add an attachment? and how to I set BCC account.
Much obliged. 

Robert</description>
		<content:encoded><![CDATA[<p>Awesome work, any idea on how to add an attachment? and how to I set BCC account.<br />
Much obliged. </p>
<p>Robert</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eugene Kurz</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-83563</link>
		<dc:creator>Eugene Kurz</dc:creator>
		<pubDate>Wed, 17 Dec 2008 07:55:46 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-83563</guid>
		<description>Hello. I&#039;m wondering if there&#039;s a way to reconfigure this script to mail contents of a web page from Safari.

Any thoughts?

Thanks,
Eugene</description>
		<content:encoded><![CDATA[<p>Hello. I&#8217;m wondering if there&#8217;s a way to reconfigure this script to mail contents of a web page from Safari.</p>
<p>Any thoughts?</p>
<p>Thanks,<br />
Eugene</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael McCrystal</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-83504</link>
		<dc:creator>Michael McCrystal</dc:creator>
		<pubDate>Tue, 30 Sep 2008 11:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-83504</guid>
		<description>I found the answer almost as soon as I posted the question. I had saved my email text as RTF and not as a text file.

Thank you again for working through this.</description>
		<content:encoded><![CDATA[<p>I found the answer almost as soon as I posted the question. I had saved my email text as RTF and not as a text file.</p>
<p>Thank you again for working through this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael McCrystal</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-83503</link>
		<dc:creator>Michael McCrystal</dc:creator>
		<pubDate>Tue, 30 Sep 2008 11:33:00 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-83503</guid>
		<description>I&#039;m running into an error and was hoping you&#039;ve already seen it and found a work around. When I run the script it works fantastic, however, it is messing with the message text. The start of the message looks like this&quot;

&quot;{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf350
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\info
{\author Michael J. McCrystal}
{\*\copyright Copryright 2006 Michael J. McCrystal }}\margl1440\margr1440\vieww9000\viewh8400\viewkind0
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural

\f0\fs24 \cf0 Hey Everyone,\&quot;

Have I done something wrong in the process?

Thanks so much for dreaming this up. I&#039;ve been looking for a good way to do this for a long time.</description>
		<content:encoded><![CDATA[<p>I&#8217;m running into an error and was hoping you&#8217;ve already seen it and found a work around. When I run the script it works fantastic, however, it is messing with the message text. The start of the message looks like this&#8221;</p>
<p>&#8220;{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf350<br />
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}<br />
{\colortbl;\red255\green255\blue255;}<br />
{\info<br />
{\author Michael J. McCrystal}<br />
{\*\copyright Copryright 2006 Michael J. McCrystal }}\margl1440\margr1440\vieww9000\viewh8400\viewkind0<br />
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural</p>
<p>\f0\fs24 \cf0 Hey Everyone,\&#8221;</p>
<p>Have I done something wrong in the process?</p>
<p>Thanks so much for dreaming this up. I&#8217;ve been looking for a good way to do this for a long time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Kreppein</title>
		<link>http://boldlyopen.com/2008/08/26/poor-mans-mail-merge-in-apple-mail/comment-page-1/#comment-83447</link>
		<dc:creator>Michael Kreppein</dc:creator>
		<pubDate>Sat, 13 Sep 2008 20:28:40 +0000</pubDate>
		<guid isPermaLink="false">http://boldlyopen.com/?p=315#comment-83447</guid>
		<description>Gianugo,

What perfect timing!  I was looking to do this exact thing in Apple Mail and your post was at the top of the search list.  THANK YOU!

The one addition to your script I&#039;d love to see is the ability add a unique salutation.  For instance, if the text file of email addresses looked like:
Michael, email@email.com
Gianugo, email2@email2.com

Then the body of the email could be:

Dear XXXX,

Where XXXX is replaced by Michael for the first email and Gianugo for the second email.

I know Iknow, you offered up something for free and now someone wants to you add their feature.  But I do think it&#039;d be a useful feature for all.

Thanks,
Michael</description>
		<content:encoded><![CDATA[<p>Gianugo,</p>
<p>What perfect timing!  I was looking to do this exact thing in Apple Mail and your post was at the top of the search list.  THANK YOU!</p>
<p>The one addition to your script I&#8217;d love to see is the ability add a unique salutation.  For instance, if the text file of email addresses looked like:<br />
Michael, <a href="mailto:email@email.com">email@email.com</a><br />
Gianugo, <a href="mailto:email2@email2.com">email2@email2.com</a></p>
<p>Then the body of the email could be:</p>
<p>Dear XXXX,</p>
<p>Where XXXX is replaced by Michael for the first email and Gianugo for the second email.</p>
<p>I know Iknow, you offered up something for free and now someone wants to you add their feature.  But I do think it&#8217;d be a useful feature for all.</p>
<p>Thanks,<br />
Michael</p>
]]></content:encoded>
	</item>
</channel>
</rss>
