Here's my purpose: I'd like to archive messages (from Sent Items, in particular) that are older than n days to a local folder.
This could be done by having a schedule call a rule. However, there's no connection between the two in the Schedule Editor UI. And I don't think there's a way to have an AppleScript run a rule; I don't see "rule" in the Entourage dictionary. So the only solution I can think of right now is to run a schedule that executes a script and iterates through the messages in Sent Items (server side), figures out their age, and takes the action to move the ones that match. However, I seem to run across a problem with "move," as well ... it doesn't seem to want to actually move on-line messages to local folders. I've also tried "set storage to" for the message and that doesn't appear to work, either. Any ideas on how to proceed? I'm all ears ... thanks! On 8/17/04 1:46 PM, "Paul Berkowitz" <[EMAIL PROTECTED]> wrote: > On 8/17/04 10:04 AM, "Jeremy Reichman" <[EMAIL PROTECTED]> wrote: > >> Can anyone give me any tips for making scripts that are designed to be used >> with schedules and/or rules? >> >> Like, for example, what parameters are passed from the schedule/rule itself >> to a script it executes? Anything? > > Nothing. It just means that you don't have check for criteria that the rule > already checks for IF you know you will be running the script only from the > rule and not on its own. (Otherwise, there's no harm, except time lost, in > repeating the criterion checking within the script.) > > The rule criteria filters _which_ messages will be sent to the script. It's > a good idea to apply such criteria by the rule, not the script, to limit the > numbers of messages sent to the script, since the script runs on each such > message separately. I'm not certain whether the messages queue up one by one > (I think so) or whether separate instances of the script can run > simultaneously (I very much doubt it). So the fewer messages get sent to the > script, the better. > > The one and only parameter passed form the rule to the script is the message > being filtered. As you probably already know, the message is accessed by the > script this way: > > set theMsg to item 1 of (get current messages) > > > Scripts being run by a rule process messages one at a time, so 'current > messages' in this context is simply a 1-item list consisting of the message > - NOT all messages queuing up in the Inbox. (Messages awaiting rule > processing are in the appropriate Inbox - local or IMAP - while awaiting > their turn.) > > Note that if you select a bunch of messages in a folder and run a script on > them from the script menu, then 'current messages' will be the list of all > the selected messages, bit if you instead Apply a Rule from the Message menu > to them, and this rule runs a script, the rule will run as many times as > there are messages, one by one, and 'current messages' will be just each > message, one at a time, as it's being handled by the rule. So in this case > running the script, rather than the rule, on the selected messages, will be > faster. If you think you might sometimes want to use the script in this > manner, then your script should > > set currMsgs to current messages > repeat with i from 1 to (count currMsgs) > set theMsg to item i of currMsgs > -- do your stuff or call a subroutine(theMsg) > end repeat > > rather than setting theMsg to item 1 as above. It will work just as fast > from a rule, but may well work faster when applied directly to selected > messages. > -- Jeremy Reichman Information & Technology Services Rochester Institute of Technology -- To unsubscribe: <mailto:[EMAIL PROTECTED]> archives: <http://www.mail-archive.com/entourage-talk%40lists.letterrip.com/> old-archive: <http://www.mail-archive.com/entourage-talk%40lists.boingo.com/>
