Re: Scripting Entourage to Send Mail in Chunks??
Re: Scripting Entourage to Send Mail in Chunks??
- Subject: Re: Scripting Entourage to Send Mail in Chunks??
- From: Paul Berkowitz <email@hidden>
- Date: Wed, 10 Jul 2002 10:53:34 -0700
On 7/10/02 9:57 AM, "email@hidden" <email@hidden> wrote:
>
Hi Applescripters. I've had some experience Applescripting, but . . .
>
apparently not enough! If any experienced folk could look at what I'm doing
>
and tell me the (probably obvious to many, just not to me) thing I'm doing
>
wrong, it would make my day!
>
>
I'm trying to write a script that will look at the messages in my Outbox (in
>
Entourage, but it could be any Mac OS X compatible email app, if another
>
would be better), decide how many, send a few (say, 5), delay a number of
>
seconds to let the connection die, then reconnect and send another chunk
>
until every message in the Outbox has been sent. (If you care or are worried
>
about why I'm trying to do this, please read at bottom of mail.)
>
>
I wrote the following but it doesn't work:
>
>
set max to 5
>
tell application "Microsoft Entourage"
>
set n to count (every message in folder "Outbox")
>
repeat while n > 0
>
if n > max then
>
set chunklet to messages 1 thru max of folder "Outbox"
>
else
>
set chunklet to (every message in folder "Outbox")
>
end if
>
send chunklet
>
delay 15
>
set n to count (every message in folder "Outbox")
>
end repeat
>
end tell
>
>
I keep getting this error: "Microsoft Entourage got an error: Can't get
>
messages 1 thru 5 of folder "Outbox." How can I get it to . . .get the
>
messages? Or alternatively, if someone else has a better way or other
>
suggestions about how to do this that would be fabulous too, this was just
>
the best (??) way I could think of so far.
You can't get 'messages 1 thru 5': that terminology is for AppleScript lists
only, not for folder messages. But that's quite easy to do:
set allMessages to (every message in out box folder)
--allMessages is a list
set chunklet to items 1 thru 5 of allMessages
Fortunately for you, 'send' will operate on an AppleScript list. There are
better ways to do this than counting every time and making a new list every
time, but it will still work.
However
delay 15
will paralyze Entourage for the duration, (Correct you don't need 'seconds':
check the Dictionary for 'delay' in Standard Additions:
delay [integer] -- the number of seconds to delay
integer is just a number.)
Much better would be to use Entourage's own commands
repeat while connection in progress
delay 1
end repeat
or, even better:
repeat while connection in progress
end repeat
However, you probably don't need to delay at all. usually the SP restriction
is on the number of recipients per message, not the number of messages being
sent. the messages will all queue up and not jam. You should be able to send
one after another. Does Yahoo really prevent more than 5 messages at a time
from going out?
>
>
Also, for my delay I was hoping for 15 seconds or so, but when I type
>
"seconds" after delay it says, "expected end of line, but found class name."
>
Do I not need the word "seconds?" Is seconds automatic?
>
>
Any help would be most appreciated!!
>
You might want to check out a script of mine
Split Recipients
at
AppleScript Central
<
http://www.applescriptcentral.com/>
That way, you can put all your recipients into a single group, set the limit
of recipients as to your ISP (or Yahoo's) limitations (its 50 at mac.com,
for example), and the script will send as many copies as needed with that
limit.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.