• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Kok-Yong Tan <email@hidden>
  • Date: Wed, 9 Feb 2011 02:48:49 -0500


On Wed, Feb 9, 2011, at 02:20, Kok-Yong Tan wrote:

On Tue, Feb 8, 2011, at 08:02, Axel Luttgens wrote:

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.

Thank *YOU* for helping me.

Perhaps should one suspect a deeper problem coming with Mail on 10.5.x...

Okay.

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?

Not quite. Even if it starts dropping attachments with slowdowns, it not necessarily continues doing this. It can suddenly stop dropping attachments suddenly and return to normal. Without me having to restart Mail! As such, restarting Mail doesn't prove anything. i.e., sometimes it stops dropping attachments upon restart; other times, it continues dropping attachments upon restart.


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"

Uh...what's the bits in quotes in French? I have no clue how they map to the US English. Can you translate into English then I'll try looking up the equivalent commands in the US English Applescript.

Okay, never mind. Using Google, I found an online French-English dictionary and translated it to mean "Forward as Attachment," which is a valid menu option in the English version of Apple Mail so I used that.




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

And college French clued me into the fact that "À" is "To" and "Objet" is "Subject."


I'll give it a shot and let you know how it goes.

keystroke ("" & counter & " junk item(s) being submitted for processing; total size is around " & totalSize & " KB")
end tell

end tell
end tell

--
Reality Artisans, Inc. # Network Wrangling and Delousing
P.O. Box 565, Gracie Station # Apple Certified Consultant
New York, NY 10028-0019 # Apple Consultants Network member
<http://www.realityartisans.com> # Apple Developer Connection member
(212) 369-4876 (Voice) # My PGP public key can be found at <https://keyserver.pgp.com>





_______________________________________________ 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
References: 
 >SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard (From: Kok-Yong Tan <email@hidden>)
 >Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard (From: Axel Luttgens <email@hidden>)
 >Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard (From: Kok-Yong Tan <email@hidden>)
 >Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard (From: Kok-Yong Tan <email@hidden>)
 >Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard (From: Axel Luttgens <email@hidden>)
 >Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard (From: Kok-Yong Tan <email@hidden>)

  • Prev by Date: Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
  • Next by Date: Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
  • Previous by thread: Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
  • Next by thread: Re: SpamCop script which worked in Tiger suddenly dropping some attachments in Leopard
  • Index(es):
    • Date
    • Thread