Mailing Lists: Apple Mailing Lists

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

Re: New to applescript: year of




Le 27 sept. 2006 à 18:26, Francis Derive a écrit :

Hello

Thanks, I didn't thaught to the get every messages issue.

Here are two versions:

-- version 1
set {laSource, laDestination} to {"zzz", "xyz"}

tell application "Mail"
set k to count of messages of mailbox laSource
if k > 0 then
repeat with myMessage in (get every message of mailbox laSource)
if year of (get date received of myMessage) = 2005 then move myMessage to mailbox laDestination
end repeat
end if
end tell


-- version 2 here, the get is not required
set {laSource, laDestination} to {"zzz", "xyz"}

tell application "Mail"
set myMessages to every message of mailbox laSource
if (count of myMessages) > 1 then
repeat with myMessage in myMessages
if year of (get date received of myMessage) = 2005 then move myMessage to mailbox laDestination
end repeat
end if
end tell



Yvan KOENIG
 _______________________________________________
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

References: 
 >Re: New to applescript: year of (From: Yvan KOENIG <email@hidden>)
 >Fwd: New to applescript: year of (From: Yvan KOENIG <email@hidden>)
 >Re: New to applescript: year of (From: Francis Derive <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.