So Allen’s solution is 17 lines, and Paul’s is 3. Just a matter of style, or something more profound?
Mine used a 'whose' clause, which is not only shorter to write but is much quicker to execute because it harnesses the power of the application (Entourage) to do the filtering. There are some circumstances where 'whose' clauses can't be used, and then you'd need a repeat loop, with AppleScript iterating through a list, one item at a time. Allen uses two nested repeat loops, which is going to be slower. (Back in Classic, using too many 'whose' filters at once - this script uses three - could backfire by exhausting Entourage's memory - then you'd just get an error. I've never seen that happen yet in OS X, not even on my previous computer, and older G3.)
Barry's script uses a 'whose' clause to generate the list of messages, but then moves them one by one. That will still be slower than mine, but by not so much. Allen's, which generates the list by repeat loops, then tries to move the whole list at once, would make up some of the time if only Entourage could move a pre-existing AppleScript list of messages. But Entourage X unfortunately can't do that, so don't try it at home. I'd better not say more at this point...;-)
--
Paul Berkowitz
