<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.theeggeadventure.com/wikimedia/index.php?action=history&amp;feed=atom&amp;title=Print_Multiple_Emails_to_PDF</id>
	<title>Print Multiple Emails to PDF - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.theeggeadventure.com/wikimedia/index.php?action=history&amp;feed=atom&amp;title=Print_Multiple_Emails_to_PDF"/>
	<link rel="alternate" type="text/html" href="https://www.theeggeadventure.com/wikimedia/index.php?title=Print_Multiple_Emails_to_PDF&amp;action=history"/>
	<updated>2026-05-12T23:24:55Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0-beta</generator>
	<entry>
		<id>https://www.theeggeadventure.com/wikimedia/index.php?title=Print_Multiple_Emails_to_PDF&amp;diff=2397&amp;oldid=prev</id>
		<title>Brianegge at 00:49, 14 November 2012</title>
		<link rel="alternate" type="text/html" href="https://www.theeggeadventure.com/wikimedia/index.php?title=Print_Multiple_Emails_to_PDF&amp;diff=2397&amp;oldid=prev"/>
		<updated>2012-11-14T00:49:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:49, 14 November 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I needed to print a large number of emails, with each going into their own pdf file. I could not simply select the emails and forward them. They needed to be printed individually. I modified a few scripts and came up with the following. I also put mail into &amp;#039;classic&amp;#039; view, and did the search only on my Gmail All Mail folder.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I needed to print a large number of emails, with each going into their own pdf file. I could not simply select the emails and forward them. They needed to be printed individually. I modified a few scripts and came up with the following. I also put mail into &amp;#039;classic&amp;#039; view, and did the search only on my Gmail All Mail folder.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;geshi lang=&quot;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bash&lt;/del&gt;&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;geshi lang=&quot;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;applescript&lt;/ins&gt;&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;global FlName&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;global FlName&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;set destinationFolder to &amp;quot;/Users/brianegge/Archive/2012/...&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;set destinationFolder to &amp;quot;/Users/brianegge/Archive/2012/...&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key egge_wikimedia-mw_:diff:1.41:old-2396:rev-2397:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Brianegge</name></author>
	</entry>
	<entry>
		<id>https://www.theeggeadventure.com/wikimedia/index.php?title=Print_Multiple_Emails_to_PDF&amp;diff=2396&amp;oldid=prev</id>
		<title>Brianegge: Created page with &quot;I needed to print a large number of emails, with each going into their own pdf file. I could not simply select the emails and forward them. They needed to be printed individua...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.theeggeadventure.com/wikimedia/index.php?title=Print_Multiple_Emails_to_PDF&amp;diff=2396&amp;oldid=prev"/>
		<updated>2012-11-14T00:48:59Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;I needed to print a large number of emails, with each going into their own pdf file. I could not simply select the emails and forward them. They needed to be printed individua...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;I needed to print a large number of emails, with each going into their own pdf file. I could not simply select the emails and forward them. They needed to be printed individually. I modified a few scripts and came up with the following. I also put mail into &amp;#039;classic&amp;#039; view, and did the search only on my Gmail All Mail folder.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
global FlName&lt;br /&gt;
set destinationFolder to &amp;quot;/Users/brianegge/Archive/2012/...&amp;quot;&lt;br /&gt;
tell application &amp;quot;Mail&amp;quot;&lt;br /&gt;
	set theMsg to selection&lt;br /&gt;
	repeat with selectMsg in theMsg&lt;br /&gt;
		open selectMsg&lt;br /&gt;
		tell selectMsg&lt;br /&gt;
			--set background color to red --Show message processed&lt;br /&gt;
			set FlName to subject&lt;br /&gt;
			set check to count every word of FlName&lt;br /&gt;
			set messageDate to date received of selectMsg&lt;br /&gt;
			--display dialog check&lt;br /&gt;
			set FlName to (my date_format(messageDate)) &amp;amp; &amp;quot; &amp;quot; &amp;amp; my time_format(messageDate) &amp;amp; &amp;quot; &amp;quot; &amp;amp; (my FixFileName(FlName)) --strip bad characters&lt;br /&gt;
		end tell&lt;br /&gt;
		&lt;br /&gt;
		set process_name to &amp;quot;Mail&amp;quot;&lt;br /&gt;
		activate application process_name&lt;br /&gt;
		tell application &amp;quot;System Events&amp;quot;&lt;br /&gt;
			tell process process_name&lt;br /&gt;
				--display dialog &amp;quot;proposed File Name&amp;quot; &amp;amp; return &amp;amp; FlName&lt;br /&gt;
				keystroke &amp;quot;p&amp;quot; using command down&lt;br /&gt;
				delay 2&lt;br /&gt;
				set PDFref to sheet 1 of window 1&lt;br /&gt;
				click menu button &amp;quot;PDF&amp;quot; of PDFref&lt;br /&gt;
				click menu item &amp;quot;Save as PDF…&amp;quot; of menu 1 of menu button &amp;quot;PDF&amp;quot; of PDFref&lt;br /&gt;
				delay 1.5&lt;br /&gt;
				# keystroke &amp;quot;g&amp;quot; using {command down, shift down}&lt;br /&gt;
				# repeat until exists sheet 1&lt;br /&gt;
				# 	delay 0.2&lt;br /&gt;
				# end repeat&lt;br /&gt;
				# tell sheet 1&lt;br /&gt;
				#	set value of text field 1 to POSIX path of destinationFolder&lt;br /&gt;
				#	click button &amp;quot;Go&amp;quot;&lt;br /&gt;
				#end tell&lt;br /&gt;
				#repeat while exists sheet 1&lt;br /&gt;
				#	delay 0.2&lt;br /&gt;
				#end repeat&lt;br /&gt;
				keystroke FlName&lt;br /&gt;
				keystroke return -- save&lt;br /&gt;
			end tell&lt;br /&gt;
		end tell&lt;br /&gt;
		delay 5&lt;br /&gt;
		close window 1&lt;br /&gt;
	end repeat&lt;br /&gt;
end tell&lt;br /&gt;
&lt;br /&gt;
on FixFileName(str) --Deletes characters that cannot be used in file names&lt;br /&gt;
	set fixed_string to {}&lt;br /&gt;
	set bad_char to {&amp;quot;:&amp;quot;, &amp;quot;/&amp;quot;}&lt;br /&gt;
	repeat with c from 1 to (count every character in str)&lt;br /&gt;
		if bad_char contains (character c of str) then&lt;br /&gt;
			set end of fixed_string to &amp;quot;-&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			set end of fixed_string to (character c of str)&lt;br /&gt;
		end if&lt;br /&gt;
	end repeat&lt;br /&gt;
	fixed_string as string&lt;br /&gt;
end FixFileName&lt;br /&gt;
&lt;br /&gt;
to date_format(old_date) -- Old_date is text, not a date.&lt;br /&gt;
	set {year:y, month:m, day:d} to old_date&lt;br /&gt;
	tell (y * 10000 + m * 100 + d) as string to text 1 thru 4 &amp;amp; &amp;quot;-&amp;quot; &amp;amp; text 5 thru 6 &amp;amp; &amp;quot;-&amp;quot; &amp;amp; text 7 thru 8&lt;br /&gt;
end date_format&lt;br /&gt;
&lt;br /&gt;
to time_format(old_date)&lt;br /&gt;
	my FixFileName(time string of (old_date))&lt;br /&gt;
end time_format&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
tell application &amp;quot;Mail&amp;quot;&lt;br /&gt;
	close window 1&lt;br /&gt;
	open message id 164149 of mailbox &amp;quot;[Gmail]/All Mail&amp;quot; of account &amp;quot;Gmail&amp;quot;&lt;br /&gt;
		--&amp;gt; missing value&lt;br /&gt;
	get subject of message id 164149 of mailbox &amp;quot;[Gmail]/All Mail&amp;quot; of account &amp;quot;Gmail&amp;quot;&lt;br /&gt;
		--&amp;gt; &amp;quot;Re: October invoice&amp;quot;&lt;br /&gt;
	get date received of message id 164149 of mailbox &amp;quot;[Gmail]/All Mail&amp;quot; of account &amp;quot;Gmail&amp;quot;&lt;br /&gt;
		--&amp;gt; date &amp;quot;Monday, November 7, 2011 9:11:54 AM&amp;quot;&lt;br /&gt;
	activate&lt;br /&gt;
end tell&lt;br /&gt;
tell application &amp;quot;System Events&amp;quot;&lt;br /&gt;
	keystroke &amp;quot;p&amp;quot; using command down&lt;br /&gt;
	get sheet 1 of window 1 of process &amp;quot;Mail&amp;quot;&lt;br /&gt;
		--&amp;gt; sheet 1 of window &amp;quot;Re: October invoice — All Mail&amp;quot; of application process &amp;quot;Mail&amp;quot;&lt;br /&gt;
	click menu button &amp;quot;PDF&amp;quot; of sheet 1 of window &amp;quot;Re: October invoice — All Mail&amp;quot; of application process &amp;quot;Mail&amp;quot;&lt;br /&gt;
		--&amp;gt; menu button &amp;quot;PDF&amp;quot; of sheet 1 of window &amp;quot;Re: October invoice — All Mail&amp;quot; of application process &amp;quot;Mail&amp;quot;&lt;br /&gt;
	click menu item &amp;quot;Save as PDF…&amp;quot; of menu 1 of menu button &amp;quot;PDF&amp;quot; of sheet 1 of window &amp;quot;Re: October invoice — All Mail&amp;quot; of application process &amp;quot;Mail&amp;quot;&lt;br /&gt;
		--&amp;gt; menu item &amp;quot;Save as PDF…&amp;quot; of menu &amp;quot;PDF&amp;quot; of menu button &amp;quot;PDF&amp;quot; of sheet 1 of window &amp;quot;Re: October invoice — All Mail&amp;quot; of application process &amp;quot;Mail&amp;quot;&lt;br /&gt;
	keystroke &amp;quot;2011-11-07 9-11-54 AM Re- October invoice&amp;quot;&lt;br /&gt;
	keystroke &amp;quot;&lt;br /&gt;
&amp;quot;&lt;br /&gt;
end tell&lt;br /&gt;
tell application &amp;quot;Mail&amp;quot;&lt;br /&gt;
	close window 1&lt;br /&gt;
end tell&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;/div&gt;</summary>
		<author><name>Brianegge</name></author>
	</entry>
</feed>