• 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: Mac Mail Questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mac Mail Questions


  • Subject: Re: Mac Mail Questions
  • From: Graff <email@hidden>
  • Date: Tue, 17 Feb 2004 16:55:14 -0500

You can always check the background activity count and only quit when it is zero:
------------
tell application "Mail"
repeat while (background activity count > 0)
delay 5
end repeat
quit
end tell
------------

Since Mail.app can get hung up sometimes you might also want to put a maximum number of times to loop in there:
------------
tell application "Mail"
set maxLoops to 5
repeat while (background activity count > 0) and (maxLoops > 0)
set maxLoops to maxLoops - 1
delay 5
end repeat
quit
end tell
------------


- Ken

On Feb 17, 2004, at 1:13 PM, Oakley Masten wrote:

Hi to All

How would I go about verifying that a message has been sent? [before closing the mail program]
I am working on a script to create a "NewMessage" , add an image attachment, send the NewMessage then close Mac Mail.
It all works just fine - EXCEPT - the "Quit" mail command closes the mail program before the message has been completely sent. When mail is reopened the message finishes being sent.

I could put a delay command between the send and quit commands but that would not account for a slow transfer and might time out before the file is completely sent. If I set the delay to 300 seconds [for example] - how do I tell Mac Mail application to run in the background until timeout?

Best regards
Oakley
_______________________________________________
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.
_______________________________________________
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.

  • Follow-Ups:
    • Re: Mac Mail Questions
      • From: Jeff Porten <email@hidden>
References: 
 >Mac Mail Questions (From: Oakley Masten <email@hidden>)

  • Prev by Date: Re: Mac Mail Questions
  • Next by Date: UI Scripting Display's Resolution
  • Previous by thread: Re: Mac Mail Questions
  • Next by thread: Re: Mac Mail Questions
  • Index(es):
    • Date
    • Thread