Re: Mail.app script query
Re: Mail.app script query
- Subject: Re: Mail.app script query
- From: Philip Aker <email@hidden>
- Date: Thu, 11 Jul 2002 03:08:06 -0700
On Wednesday, July 10, 2002, at 08:48 AM, Amazon Consultants -
Eric wrote:
I have a simple Entourage script (below) which attaches a
specific file to a
new mail window with some defaults. I9d like to do the same thing in
Mail.app but as an AppleScript newbie I find the Mail
Dictionary a little
confusing. I9ve tried loads of stuff but can9t get it going. Can anyone
help? Any comments would be gratefully received, no matter how small.
Hi Eric,
Try this (substituting a real email address and name):
------------------------
set maddress to "email@hidden"
set mname to "X"
set msubject to "Test"
set mcontent to "Hi!" & return & "Bye" & return & return
set mfile to (choose file)
tell application "Mail"
activate
try
set msg to make new compose message at beginning of
compose messages with properties {subject:msubject,
content:mcontent}
tell msg
make new to recipient at beginning of to
recipients with properties {address:maddress, display name:mname}
tell content
make new text attachment with properties {file
name:mfile} at before the last word of the last paragraph
end tell
end tell
send msg
on error errstr
display dialog errstr buttons {"OK"} default button
"OK" with icon note
end try
end tell
------------------------
I'm using OS X 10.1.5
Philip
p h i l i p @ v c n . b c . c a
h t t p : / / w w w . a k e r . c a /
_______________________________________________
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.