• 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: Mail Quits Unexpectedly Using An AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail Quits Unexpectedly Using An AppleScript


  • Subject: Re: Mail Quits Unexpectedly Using An AppleScript
  • From: "email@hidden" <email@hidden>
  • Date: Wed, 14 Dec 2005 08:49:38 +0100

You might also have a look to XMail, a free scripting addition that allow you to send mails without using a third party application. XMail is free, open source, supports many authentication schemes, Unicode compliant (and many more good things). You can get a copy of it here : <http://lestang.org/osax/XMail/>.

--
Jean-Baptiste LE STANG

Le 12 déc. 05, à 22:19, Ted a écrit :

On Dec 12, 2005 kai wrote:

Let's just keep our fingers crossed that a few fixes for Mail
scripting are forthcoming soon...

This might have something to do with a problem I've been having. I've scripted FMPro 6 to attach a pdf to a Mail message via AppleScript. It works fine except for the fact that Mail quits unexpectedly about 95% of the time I run it. It doesn't matter if I'm sending 1 pdf or 15 pdf's. It usually quits on me. Here's the AppleScript portion:


-- 1st AS
-- This creates the pdf
set homePath to (path to home folder as text)
set theFilePath to homePath & cell "PDFLocation_TempPO_c" of current record
tell app "FileMaker Pro" to set the newName to cell "Invoice_#" of current record
tell app "Finder" to set the name of file theFilePath to newName & ".pdf"


FMPro pauses for 2 seconds here

-- 2nd AS
-- This sends the pdf
set theName to ""
set theAddress to "email@hidden"
set theSender to "email@hidden"
set theSubject to "P.O.#K5-7443"
set theBody to ""
set homePath to (path to home folder as text)
set theAttachment to (homePath & "business:pdfSent:K5-7443.pdf") as alias


tell application "Mail"
set newMessage to make new outgoing message with properties ¬
{subject:theSubject, content:theBody}
tell newMessage
-- Default is false. Determines whether the compose window will
-- show on the screen or whether it will happen in the background.
set visible to true
set sender to theSender
make new to recipient at end of to recipients with properties ¬
{name:theName, address:theAddress}
tell content
-- Position must be specified for attachments
make new attachment with properties {file name:theAttachment} at ¬
after the last paragraph
end tell
end tell
send newMessage
end tell


I added the 2 second pause between the scripts thinking that might help, but it doesn't. Am I doing something wrong or could there be a bug in Mail?

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


This email sent to email@hidden


_______________________________________________ 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
  • Follow-Ups:
    • Re: Mail Quits Unexpectedly Using An AppleScript
      • From: Wayne Melrose <email@hidden>
References: 
 >Mail Quits Unexpectedly Using An AppleScript (From: Ted <email@hidden>)

  • Prev by Date: Re: Multiple IF conditions in one line & path to Users Library
  • Next by Date: Re: Mail Quits Unexpectedly Using An AppleScript
  • Previous by thread: Re: Mail Quits Unexpectedly Using An AppleScript
  • Next by thread: Re: Mail Quits Unexpectedly Using An AppleScript
  • Index(es):
    • Date
    • Thread