Anyone know how to get a MailRuleCondition object from a MailRule?
I have no problem getting the rest of the parts of a rule but I
can't get the rule conditions. I thought I could just do something
like this:
What I get is something like this:
<MailRuleCondition @0x1e25c0: MailRuleCondition "expression" of
MailRule 22 of application "Mail" (8087)>
Hey, you asked for a specifier for a rule condition by name, and
that's what you got. Remember, specifiers in Scripting Bridge are
lazy -- -objectAtIndex: and -objectWithName: just build a new
specifier, they don't actually get any data. You have to ask for a
property to do that.
Seriously, though, the problem is that rule conditions are objects,
not just an expression string, and they don't have names. Use -
objectAtIndex:, and then get properties of the result. For example: