Scripting Mail.app

This area contains the messages from the old Yahoo gcmac group after the port.
Post Reply
thorstenlemke
Posts: 0
Joined: Fri Dec 30, 2016 12:00 pm

Scripting Mail.app

Post by thorstenlemke »

Hello, can anyone help me? I try to attach a file to mail.app. The attached script= doesn´t work. Thorsten -- 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", "someone@somewhere.com", "nice e-mail", = "OK", 1, {"/Volumes/HD 60GB/test.jpg", "xx"}) end run
Post Reply