• 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: visual email again
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: visual email again


  • Subject: Re: visual email again
  • From: Adam Morris <email@hidden>
  • Date: Mon, 30 Mar 2009 20:55:21 +0900

So if you setup a rule to filter your new emails couldn't you just have that rule run a script to run an automator workflow that is saved as an app that grabs the addressees email, your html file and create a new message that way

I swear I tried using an automator app in the past to solve the problem and it didn't work. I tried again and now it has. So YES an enthusiastic yes that works! (Wonder what I was doing wrong previously...)

Write the perform mail action script to do the following two simple things:

1) Open the Automator Application
2) Set read status to true 

property nameofAutomatorApp : "Launch Mail Script" -- must be saved in Applications folder!

using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application nameofAutomatorApp to launch -- or use Finder's open method to launch the app


repeat with thisone in theMessages
set read status of thisone to true
end repeat


end perform mail action with messages
end using terms from

Then in the Automator actions, use the Find Messages in Mail to set the criteria I need, and then use the Run Applescript and the following:

on run {input, parameters}
repeat with thisMessage in input
tell application "Mail"
set towho to reply to of thisMessage
set newone to make new outgoing message with properties {visible:true}
tell newone
set subject to "success"
make new to recipient with properties {address:towho}
end tell
end tell
end repeat
return input
end run

And sure enough I get a new message with "success" as the subject! (This does NOT work from within a perform rule action)

The main disadvantage here though is that the Automator's Find Message combs through every message in your inbox, which is a (relatively) major tax on your machine. Which is why I wrote the following to replace the Find Mail action, which gets us a result a heck of a lot faster:

property subject_criteria : "show me"

on run {input, parameters}
set toreturn to {}


tell application "Mail"


set allunread to every message of inbox whose read status is false


repeat with thisunread in allunread
if subject of thisunread contains subject_criteria then copy thisunread to the end of toreturn
end repeat


end tell


return toreturn
end run

Still haven't solved the embedding an HTML file in a Mail message though, have we?


On 30 Mar 2009, at 10:57, Mr. Thomas Boardman wrote:

I have setup a mail rule that when I get an email with the subject "picture" the rule runs a script that opens and runs an automator workflow and then sends out the snap shot in a new email message to a different email account of mine.
So if you setup a rule to filter your new emails couldn't you just have that rule run a script to run an automator workflow that is saved as an app that grabs the addressees email, your html file and create a new message that way? I also use Automator to check the upcoming week for birthdays and if finds one send a generic birthday message to the recipient.

I don't think what you are wanting to do is difficult but it may require multiple actions from different applications and/ or scripts to accomplish it.

Thomas A. Boardman
email@hidden
Sent Via MacBook Pro


 _______________________________________________
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: visual email again
      • From: "email@hidden" <email@hidden>
References: 
 >re: visual email again (From: Adam Morris <email@hidden>)
 >Re: visual email again (From: "Mr. Thomas Boardman" <email@hidden>)

  • Prev by Date: Re: visual email again
  • Next by Date: Re: visual email again
  • Previous by thread: Re: visual email again
  • Next by thread: Re: visual email again
  • Index(es):
    • Date
    • Thread