• 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: Set variable to contents of incoming message
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Set variable to contents of incoming message


  • Subject: Re: Set variable to contents of incoming message
  • From: Michelle Steiner <email@hidden>
  • Date: Fri, 17 Aug 2012 09:36:35 -0700

On Aug 17, 2012, at 9:18 AM, Neil Laubenthal wrote:

When/if you finish modifying Michelle's suggestion; please post with your final script, rule, and what you are doing with the info once you get it to the file. As cyclemeter user myself I'm happy to borrow other people's efforts to help with the logging/analysis process.

Turns out that Apple provides a template for mail actions; I extracted the part for message content, but have not tested it.

using terms from application "Mail"
on perform mail action with messages these_messages for rule this_rule
tell application "Mail"
set the message_count to the count of these_messages
repeat with i from 1 to the message_count
set this_message to item i of these_messages
try
set this_content to (every character of content of this_message) as Unicode text
if this_content is in {"", "?"} then error
on error error_message
set this_content to "NO CONTENT"
end try
end repeat
end tell
end perform mail action with messages
end using terms from

-- Michelle

-- 
"Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed."
President Dwight D. Eisenhower, April 16, 1953

 _______________________________________________
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

  • Follow-Ups:
    • Re: Set variable to contents of incoming message
      • From: John <email@hidden>
    • Re: Set variable to contents of incoming message
      • From: John <email@hidden>
References: 
 >Set variable to contents of incoming message (From: Tony Bennett <email@hidden>)
 >Re: Set variable to contents of incoming message (From: Neil Laubenthal <email@hidden>)

  • Prev by Date: Re: Set variable to contents of incoming message
  • Next by Date: Re: Set variable to contents of incoming message
  • Previous by thread: Re: Set variable to contents of incoming message
  • Next by thread: Re: Set variable to contents of incoming message
  • Index(es):
    • Date
    • Thread