Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
- Subject: Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
- From: Axel Luttgens <email@hidden>
- Date: Tue, 8 Feb 2011 14:02:36 +0100
Le 8 févr. 2011 à 05:25, Kok-Yong Tan a écrit :
> On Mon, Feb 7, 2011, at 12:14, Kok-Yong Tan wrote:
>
>> [...]
>>
>> Many thanks, Axel. I've typed it in and it seems to run fine after I corrected the variable "sourceFilePath" above to "sourceFile" as the former isn't defined. As I mentioned in my original email, even with Leopard 10.5.8 Mail, the dropouts only happen sporadically so it's not a consistently reproducible problem (which makes debugging all that much harder). I'll try running your version for a while from within the Script Editor for debugging purposes and see if the same problem crops up again. I'll report back over the next couple of weeks or so.
>>
>> Tan
>
> Okay, reporting back as promised. Initial runs of the above script seemed to work although it ran really, really, really slow--about the same speed as when it was run in Tiger Mail. Then just five minutes ago, running with 5 spams selected resulted in it dropping spams 3 and 4 which I had to manually add in. I guess it didn't help. Running it again against the same 5 spams by moving them from Trash to my Spam folder resulted in it attaching spams 1, then 3-5 but dropping spam 2. Different runs caused different results in the attachment process. It always seems to be the attachment process--when I check the temporary files, they are sitting there ready to be attached. Instead of having them all attach on the fly, I'm going to try processing them all then coming back and attaching them in another separate loop by itself.
Hello Tan,
Thanks for the follow-up.
Perhaps should one suspect a deeper problem coming with Mail on 10.5.x...
Could you try to quit then re-launch Mail once it begins with those slowdowns/dropouts, and then immediately run the script? Does it then run quicker/more reliably?
Anyway, if you don't mind some GUI scripting, perhaps could it be worth to give it a try; here follows a skeleton (you'll need to localize it, and possibly to adapt it for your version of Mail):
set SCaccount to "YOURACCOUNT"
tell application "Mail"
set counter to count of selection
set totalSize to 0
repeat with M in (get selection)
set totalSize to totalSize + (message size of M)
end repeat
end tell
set totalSize to round (totalSize / 1024)
tell application "Mail" to activate
tell application "System Events"
tell application process "Mail"
tell menu item "Réexpédier en tant que pièce jointe" of menu 1 of menu bar item "Message" of menu bar 1 to perform action "AXPress"
tell front window
set focused of first text field of first item of (scroll areas whose (name of text field 1 is "À :")) to true
keystroke SCaccount
set focused of text field "Objet :" to true
keystroke ("" & counter & " junk item(s) being submitted for processing; total size is around " & totalSize & " KB")
end tell
end tell
end tell
HTH,
Axel
_______________________________________________
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