On Feb 08, 2012, at 02:42, David Ferrington wrote:
In which way are attachments broken in Lion - are they only broken in A/S or are they broken full stop?
______________________________________________________________________
Hey David,
Attachments work fine in Lion's Mail.app, but attaching them via script is broken.
--
Best Regards,
Chris
I've got a very long script that uses multiple instances of adding attachments to Mail, in Lion, and it works fine.
Part of the script is added below.
try
set LogoPath to MailPrintingFolder & ":Logo.png"
set LogoPath to POSIX path of LogoPath
on error
set LogoPath to ""
end try
tell application "Mail"
activate
set newMessage to make new outgoing message with properties {visible:true, subject:the_subject, content:the_content}
tell content of newMessage
try
set y to count of the_content
set color of characters 1 thru y to textcolor
end try
set x to offset of TheBusinessName in the_content
set font of characters x thru (x + (count of TheBusinessName) - 1) to "Helvetica Bold"
set color of characters x thru (x + (count of TheBusinessName) - 1) to {56342, 2442, 607}
repeat with x from 1 to (count of the_content)
if character x of the_content = "●" then
set color of character x to {56342, 2442, 607}
end if
end repeat
end tell
tell newMessage
try
make new attachment with properties {file name:LogoPath} at before the first paragraph
end try
repeat with themailitem in MainMailRecipient
make new to recipient at end of to recipients with properties {address:themailitem}
end repeat
repeat with themailitem in ReportCCRecepients
make new cc recipient at end of cc recipients with properties {address:themailitem}
end repeat
end tell
tell newMessage
send
delay 1
try
close saving no
end try
end tell
end tell