Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Mail crashes constantly

I have part of my script attaching a pdf to a mail message and sending it out. Mail "unexpectedly quits" almost after every message. Is it something wrong with my script?

heres the part where the message gets made and sent:

set subj to "Proof for " & AdName
set EmailFile to POSIX path of fileName --Mail likes UNIX file paths instead of AppleScript (/ instead of : path delimiters)
tell application "Mail"
set outMessage to make new outgoing message with properties {visible:true, subject:subj, content:"" & return & return}
tell outMessage
make new to recipient at end of to recipients with properties {address:(Email)}
tell content to make new attachment at after last paragraph with properties {file name:EmailFile}
end tell
send outMessage
end tell

Posted on Oct 21, 2008 8:43 AM

Reply
3 replies

Oct 21, 2008 10:59 AM in response to BenChase

Hi BenChase

try replacing this line::

set EmailFile to POSIX path of fileName

with this::

set EmailFile to POSIX path of fileName as alias


and this line::

tell content to make new attachment at after last paragraph with properties {file name:EmailFile}

with this::

tell content to make new attachment with properties {file name:EmailFile as alias} at after the last paragraph


that may help

Budgie

Mail crashes constantly

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.