• 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: gaining control
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: gaining control


  • Subject: RE: gaining control
  • From: Rob Jorgensen <email@hidden>
  • Date: Sun, 26 Oct 2003 09:46:54 -0500

At 7:00 AM -0600 10/26/03, Jim Brandt wrote:
It sends every file in folder "HD1:To_Be_Sent:" as an attachment
in one email message.

It all works great except quit command tries to execute while the
message is still being sent. Under previous versions of Eudora,
control never came back to the script until the transfer was complete.
Now I'm getting a dialog that needs to be responded to, because I'm
trying to quit while the send is taking place in the background (ain't
multitasking wonderful :).

There are times when I want to just walk away while the script does
its thing without needing to deal with a dialog.

This appears to work for me. I've done some rearranging to limit the amount of nested code within the Finder tell blocks (I'm just weird that way).

set script_filename to "OSX:Library:Scripts:My_Lib"
set My_Lib to load script file script_filename
set sourceFolder to "HD1:To_Be_Sent:"
set thedate to my Get_ddmmmyy(current date) of My_Lib

tell application "Finder"
--activate
--open sourceFolder
set theList to (every item of folder sourceFolder whose kind is not "folder")
end tell

if (count of the theList) = 0 then
display dialog "Nothing to send"
error number -128
end if

with timeout of 600 seconds -- 10 minutes
tell application "Eudora"
activate

set my_id to make message at end of mailbox "Out" of mail folder ""
tell my_id
set field "to" to "me_at_work"
set field "subject" to thedate
repeat with n from 1 to the count of the theList
attach to it documents ((item n of theList) as alias)
end repeat
queue it
end tell

connect with sending without checking

repeat
if status of my_id is not sent then
delay 10
else
exit repeat
end if
end repeat
quit
end tell
end timeout

tell application "Finder"
activate
-- move theList to folder "HD1:To_Be_Sent: Sent:" with replacing
end tell

Tested with Eudora 6 and OS X 10.2.8. A couple of things which might cause the script to throw the warning dialog:

- Other queued messages which are not handled/monitored by the script.

- Eudora is not running when the script is executed, possibly causing an immediate mail check when the script launches Eudora (depending on how Eudora is configured). If the check takes much time, and/or a large number of messages are being downloaded, it would likely cause the warning (transfer in progress) when the quit command is issued.

-- Rob
_______________________________________________
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: gaining control
      • From: Christopher Stone <email@hidden>
References: 
 >RE: gaining control (From: Jim Brandt <email@hidden>)

  • Prev by Date: Very Odd
  • Next by Date: Re: Very Odd
  • Previous by thread: RE: gaining control
  • Next by thread: Re: gaining control
  • Index(es):
    • Date
    • Thread