Revising a script that worked in Entourage for use in Apple Mail
Revising a script that worked in Entourage for use in Apple Mail
- Subject: Revising a script that worked in Entourage for use in Apple Mail
- From: Ramona Rock <email@hidden>
- Date: Wed, 29 Aug 2007 00:36:16 -0700
Title: Revising a script that worked in Entourage for use in Apple Mail
Hi there. I’ve been using an Applescript that I like very much in Microsoft Entourage. I’d like to try using Apple’s Mail, but I’d like to keep using my Applescripts. They don’t work like they did in Entourage, sadly. Well, some do, some don’t.
I have one that sends email out in pulses from a mail folder I called Goosh. (FYI: It’s for an opt-in list, and yes, users can opt-out easily, it’s NOT spam.) Nevertheless, some of it gets trapped in spam filters if I send all at once, so I pulse it out gradually. I was running it via Entourage’s Schedules, but I figured I could omit the schedule step and just introduce a delay in the script itself and then run it as a stand alone Applescript Application to interact with Mail. Here’s the script, the original one used in Entourage that worked quite nicely:
set max to 50
set n to 50
tell application "Microsoft Entourage"
set allMessages to (every message in folder "Goosh")
try
with timeout of 500 seconds
set n to count allMessages
end timeout
end try
if n < max then
send (every message in folder "Goosh")
set enabled of schedule "Goosh" to false
else
set cutOff to time sent of message max of folder "Goosh"
send (every message in folder "Goosh" whose time sent ¾ cutOff)
end if
end tell
I prefer to generate the mail, then move it to another folder (“Goosh”) then send it gradually from there rather than leaving it in the outbox, so it can kind of “do its own thing” in the background. The number 50 is the number of email messages to send at once. I did figure out I have to use the word mailbox instead of folder and change “time sent” to “date sent.” I’d omit the “set enabled of schedule “Goosh” to false” (that being a schedule also called Goosh in Entourage), and just stick a delay of several minutes in there someplace. I made those changes, and now it’s throwing out an Applescript Error: Mail got an error: NSReceiversCantHandleCommandScriptError.
I don’t even know what that means. :( I thought this would be a simple thing, but it’s turning out not to be so much, at least . . . FOR ME.
I was hoping there might be someone on this list that could just tell me how to fix this in five seconds. Please with sugar? :) I have a bunch of example scripts for Mail, but curiously, none of them seem to involve sending messages. I guess I’m getting the terminology or language wrong with that? Or is what I’m trying to do somehow fundamentally impossible in Apple Mail? (I hope not.)
Any help appreciated muchly!
Ramona
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden