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




Fireworks !

More than 5200 messages moved is less than - say 10 seconds - for the script to return.
It does takes time afterwards for Mail to awake from the shock and show evidence of the global move in its message viewer.


	Many thanks for showing the path.

Francis.


On Sep 28, 2006, at 12:54 PM, has wrote

That'll work, but it'll be slow. Much quicker to get Mail to move all the messages in one go:

on makeDate(y, mo, d, h, mi, s)
(*
Make new date object given, year, month, day, hour, minute and second as integers (month can also be given as a constant). Doesn't use date strings, so isn't affected by users' Date & Time preferences (i.e. localisation-independent).
*)
set dt to date (get "1")
set monthNames to {January, February, March, April, May, June, July, August, September, October, November, December}
if mo is not in monthNames then set mo to item mo of monthNames
set {dt's year, dt's month, dt's day} to {y, mo, d}
set dt's time to h * hours + mi * minutes + s
return dt
end makeDate


set myYear to 2005
set {laSource, laDestination} to {"zzz", "xyz"}

set startDate to makeDate(myYear, 1, 1, 0, 0, 0)
set endDate to makeDate(myYear + 1, 1, 1, 0, 0, 0)
tell application "Mail"
move (every message of mailbox laSource whose date received ≥ startDate and date received < endDate) to mailbox laDestination
end tell



has -- http://freespace.virgin.net/hamish.sanderson/ http://appscript.sourceforge.net
_______________________________________________
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: has <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.