• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Modifying incoming mail subject
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modifying incoming mail subject


  • Subject: Re: Modifying incoming mail subject
  • From: Michaël Grünewald <email@hidden>
  • Date: Fri, 28 Dec 2007 18:45:54 +0100


Le 28 déc. 07 à 04:07, Mark J. Reed a écrit :

What are you setting "theMessages" to?
And you might consider using "display dialog" instead of "say", unless
of course you chose the latter due to a visual impairment.

I have used `say' because the Applescript's introduction introduce it simultaneously as `log' and presents them as deserving a common use. I find the dialog alternative much more pleasant!


The code I have posted here is a mere patch of lines found here and there. In order to understand it, I relied on the following bits of documentation:
-- DOKU
perform mail action with messages v : Script handler invoked by rules and menus that execute AppleScripts. The direct parameter of this handler is a list of messages being acted upon.


perform mail action with messages list of message : the message being acted upon

[in mailboxes mailbox] : If the script is being executed by the user selecting an item in the scripts menu, this argument will specify the mailboxes that are currently selected. Otherwise it will not be specified.

[for rule rule] : If the script is being executed by a rule action, this argument will be the rule being invoked. Otherwise it will not be specified.
-- DOKU
The previous excerpt can be found in Mail app's dictionary.


As far as I understand this, the the parameter referred to as `theMessages' in my code is set by the party calling the script; but I maybe misunderstand the first paragraph of the reproduced excerpt.

-- SCRIPT
using terms from application "Mail"
	on perform mail action with messages theMessages for rule theRule
		tell application "Mail"
			say "Hello"
			set text item delimiters to "[Caml-list] "
			repeat with eachMessage in theMessages
				say "This goes on and on"
				set theSubject to the subject of eachMessage
				set theAnswer to ""
				repeat with thePart in text items of theSubject
					set theAnswer to theAnswer & thePart
				end repeat
				set subject of eachMessage to (theAnswer)
			end repeat
		end tell
	end perform mail action with messages
end using terms from
-- SCRIPT

Cheers, Micha






___________________________________________________________________________ Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire. http://fr.mail.yahoo.com _______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
References: 
 >Modifying incoming mail subject (From: Michaël Grünewald <email@hidden>)
 >Re: Modifying incoming mail subject (From: has <email@hidden>)
 >Re: Modifying incoming mail subject (From: Michaël Grünewald <email@hidden>)
 >Re: Modifying incoming mail subject (From: "Mark J. Reed" <email@hidden>)

  • Prev by Date: Re: Newbie stuff
  • Next by Date: Re: Modifying incoming mail subject
  • Previous by thread: sh-appscript (was: Re: Modifying incoming mail subject)
  • Next by thread: Re: Modifying incoming mail subject
  • Index(es):
    • Date
    • Thread