Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Redirect a message in Mail



I'm trying to script Mail to redirect any messages I've select to a given email address. I had this working perfectly in Panther, and somehow during my Tiger upgrade I lost my script and now have to recreate it. I know Mail is quirky to script, but I thought my previous one went something like this ...

set msgs to get selection
repeat with i from 1 to length of msgs
    set newmsg to redirect (item i of msgs)
    tell newmsg
        make new to recipient at end of to recipients with properties {address:"email@hidden"}
        send
    end tell
end repeat

... however I'm getting a "newmsg is not defined" error. Even though the dictionary states the redirect command returns an outgoing message, my testing seems to suggest that redirect doesn't return anything and hence newmsg has no value. 

So how *should* I be doing this?

-- 
Tim Mansour <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.