• 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
"delay sent" for Apple's Mail application...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"delay sent" for Apple's Mail application...


  • Subject: "delay sent" for Apple's Mail application...
  • From: David Crowe <email@hidden>
  • Date: Wed, 13 Jul 2005 16:11:06 -0600

Title: "delay sent" for Apple's Mail application...
Eudora has the ability to send mails at a future date, and is eminently scriptable.

Here's a script that I use to send a message at 9am on the next business day (Monday to Friday) including warning me no more than once a day that the email won't go out until tomorrow:

property LastWarned : {0, 0, 0}

tell application "Finder" -- to check whether it's Eudora that's active
 
if (name of first process whose frontmost is true) does not start with "Eudora" then
           
activate
               
display dialog "This function can only be used when Eudora is active"
          
return
 
end if
end tell


set CurrentDate to current date
set CurrentDayMonthYear to {day of CurrentDate, month of CurrentDate, year of CurrentDate}
set CurrentTime to time of CurrentDate
set CurrentHours to CurrentTime div (60 * 60)
set CurrentSeconds to CurrentTime mod 60
set CurrentMinutes to (CurrentTime mod (60 * 60)) div 60

--
Don't queue on weekends
if CurrentHours < 9 and weekday of CurrentDate ‚ Sunday and weekday of CurrentDate ‚ Saturday then
 
set DaysToSkip to 0
else if weekday of CurrentDate = Friday then
set DaysToSkip to 3
else if weekday of CurrentDate = Saturday then
      
set DaysToSkip to 2
else
set DaysToSkip to 1
end if

if CurrentHours „ 9 and CurrentHours ¾ 11 then
if LastWarned ‚ CurrentDayMonthYear then
               
tell application "Eudora"
                      
activate
                       
try
                            
display dialog "This message won't be queued until 9am on the following working day." giving up after 1
               
on error
                               
return
                 
end try
       
end tell
               
set LastWarned to CurrentDayMonthYear
  
end if
end if

set TomorrowMorning to CurrentDate + ((DaysToSkip * 24) - CurrentHours + 9) * 60 * 60 - CurrentSeconds - (CurrentMinutes * 60)

tell application "Eudora"
    
try
            
queue message 1 for TomorrowMorning
    
end try
end tell


- David Crowe
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Timeout problem with iTunes 4.9
  • Next by Date: Re: soap went south?
  • Previous by thread: Timeout problem with iTunes 4.9
  • Next by thread: Tiger problem with menu scripts and Mail 2.0
  • Index(es):
    • Date
    • Thread