Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'An AppleScript to batch-redirect email in Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to batch-redirect email in Mail.app
Authored by: Bubby Johnson on May 05, '04 06:24:33PM
Applescript does not cease to amaze me in its flexiblity, usefulness and unbelievable power even in the hands of the average user. Take for example this nice script, to batch redirect emails is really slick. I do have to mention one small, little caveat to this great script: When you redirect your mail every resent mail will HONOR the BCC tags. This may not be a problem for most, but if you are like me and the thought of resending age old emails around the globe inadvertently, then maybe you should try something else. I have experiemented with the above script and not quite found a satisfactory solution to the problem. I added two lines:

delete bcc recipients
delete cc recipients
But this takes me to the reason the solution is not quite satisfactory. It does not work if you reverse the order of the commands. If "delete cc" is first, I could not get the script to successfully remove the bcc tags. And even though there may be not be any CC tags, without this command the script wouldn't work. I think maybe a BCC tag is considered the same as a cc tag. So does the first swipe just remove the "B" and the second the "CC"? If anyone knows why it would be instructive. Here is my altered script in full:

using terms from application "Mail"
	on perform mail action with messages selectedMessages
		set AppleScript's text item delimiters to ""
		set theRedirectRecipient to "JohnSmith@something.com"
		set theRedirectSender to "John Smith <JohnSmith@something.com>"
		repeat with eachMessage in selectedMessages
			tell application "Mail"
				
				set theRedirectedEmail to redirect eachMessage with opening window
				tell theRedirectedEmail
					make new to recipient at beginning of to recipients with properties {address:theRedirectRecipient}
					delete bcc recipients
					delete cc recipients
				end tell
				set the sender of theRedirectedEmail to theRedirectSender
				send theRedirectedEmail
				
			end tell
		end repeat
	end perform mail action with messages
end using terms from
I removed the Dialog box that asked if it's OK to send. Refer to the first script to put it back in. Or just copy and paste the two lines from this script and put it in your own.

[ Reply to This | # ]
An AppleScript to batch-redirect email in Mail.app
Authored by: rlboydnc on Apr 06, '06 11:59:42AM

I tried using this script ... but when I try, it seems to do absolutely nothing.

I don't see anything in the log area. How can I find out what is happening/not happening?

Thanks!



[ Reply to This | # ]
An AppleScript to batch-redirect email in Mail.app
Authored by: zzztimbo on May 08, '06 01:56:41PM

i have the same exact problem. i'm running mail under 10.4.6.
can anyone help?



[ Reply to This | # ]