• 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
Re: New to applescript: year of
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New to applescript: year of


  • Subject: Re: New to applescript: year of
  • From: Francis Derive <email@hidden>
  • Date: Thu, 28 Sep 2006 14:47:41 +0200


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:
This email sent to email@hidden


References: 
 >Re: New to applescript: year of (From: has <email@hidden>)

  • Prev by Date: Rép: New to applescript: year of
  • Next by Date: Rép: New to applescript: year of
  • Previous by thread: Re: New to applescript: year of
  • Next by thread: Extracting Data from Get Info window
  • Index(es):
    • Date
    • Thread