Adding an attachment to Mail.app
Adding an attachment to Mail.app
- Subject: Adding an attachment to Mail.app
- From: email@hidden (Thorsten Lemke)
- Date: Thu, 17 Apr 2003 15:04:41 +0200
Hello,
Why does this script not work?
-- Mail
on sendimagesasattachment(email_subject, email_address, email_comments,
cancel_string, image_count, email_files)
try
tell application "Mail"
activate
set the new_message to make new outgoing message at beginning of
every outgoing message
tell new_message
set the subject to email_subject
set the content to email_comments
repeat with image_idx from 1 to image_count
set this_imagefile to item image_count of email_files
set x to this_imagefile as Unicode text
tell content
set the new_attachment to make new attachment with
properties {file name:x}
end tell
end repeat
end tell
make new OLD message editor at beginning of every OLD message
editor
set outgoing message of last OLD message editor to new_message
end tell
on error error_message number error_number
log error_message & " " & error_number
if the error_number is not -128 then
tell application "Finder"
beep
display dialog error_message buttons {cancel_string} default
button 1
end tell
end if
end try
end sendimagesasattachment
on run
sendimagesasattachment("subject", "email@hidden", "nice
e-mail", "OK", 1, {"/Volumes/HD 60GB/test.jpg", "xx"})
end run
_______________________________________________
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.