• 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
Yosemite Mail - Creating a Rule - Failure
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Yosemite Mail - Creating a Rule - Failure


  • Subject: Yosemite Mail - Creating a Rule - Failure
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 25 Sep 2015 18:13:31 -0500

Hey Folks,

-------------------------------------------------------------------------------------------
tell application "Mail"
  set newRule to make rule at beginning with properties {name:"Move-It!"}
  newRule exists
end tell
-------------------------------------------------------------------------------------------

This is cut down from a once (2011) working example, and it returns FALSE.

-------------------------------------------------------------------------------------------
# Worked in 2011 — on Snow Leopard I believe.
# Fails on Yosemite.
-------------------------------------------------------------------------------------------
tell application "Mail"
  set newRule to make new rule at end of rules with properties {name:"Woohoo rule", forward message:"email@hidden"}
  tell newRule
    make new rule condition at end of rule conditions with properties {rule type:message content, qualifier:does contain value, _expression_:"woohoo"}
  end tell
end tell

-------------------------------------------------------------------------------------------

The new rule is NOT created...

I know Brian was fighting with something like this not too long ago.

Has anyone successfully created a rule via AppleScript in Yosemite?

Has anyone tried with El Capitan?

I have successfully created a new rule-condition in an existing rule:

-------------------------------------------------------------------------------------------
set ruleName to "Promotions-IN"

tell application "Mail"
  set msgSelList to selection

  

  if length of msgSelList = 1 then
    set mailRule to rule ruleName

    

    if mailRule exists then
      set theMsg to item 1 of msgSelList
      set msgFromAddress to (sender of theMsg)

      

      tell mailRule
        make new rule condition at end of rule conditions with properties ¬
          {rule type:from header, qualifier:does contain value, _expression_:msgFromAddress}
      end tell

      

    else
      error "The named Mail-Rule does not exist!"
    end if
  else
    error "Problem with message selection!"
  end if
end tell
-------------------------------------------------------------------------------------------

But I don't seem to be able to create a brand new rule.

--
Best Regards,
Chris

 _______________________________________________
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: Yosemite Mail - Creating a Rule - Failure
      • From: Deivy Petrescu <email@hidden>
    • Re: Yosemite Mail - Creating a Rule - Failure
      • From: Brian Christmas <email@hidden>
  • Prev by Date: Re: tags manipulation
  • Next by Date: Re: Yosemite Mail - Creating a Rule - Failure
  • Previous by thread: Re: Apple Mail "Smart Mailboxes" and Rules...
  • Next by thread: Re: Yosemite Mail - Creating a Rule - Failure
  • Index(es):
    • Date
    • Thread