• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Launch Default Mail App attached the file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launch Default Mail App attached the file


  • Subject: Re: Launch Default Mail App attached the file
  • From: Paul Berkowitz <email@hidden>
  • Date: Mon, 18 Nov 2002 18:28:03 -0800

On 11/18/02 3:18 PM, "John Delacour" <email@hidden> wrote:

> Here's (about) the shortest way I've found to make the new message,
> and what a bloody mess it looks!
>
> tell app "Mail" to tell second account
> set att_ to alias "dx:Users:jd:Documents:c.txt"
> set from_ to full name & " <" & email addresses & ">"
> set toList to {{name:"JD", address:"jd@home"}, \
> {name:"JD", address:"jd@work"}}
> set msg to make outgoing message
> tell msg
> set {visible, sender} to {true, from_}
> set subject to "Test"
> repeat with r in toList
> set toRecip to make to recipient at \
> end of to recipients with properties r
> end repeat
> set its content to "Hello" & return & return
> make attachment at after last paragraph of \
> its content with properties {file name:att_}
> end tell
> end tell

Good god!
>
> Compare this with Eudora:
>
> tell app "Eudora" to tell (make message at end of mailbox "Out")
> set its personality to (a reference to my personality 1)
> set field "to" to "JD <jd@home>, JD <jd@work>"
> set subject to "Test"
> set body to "Hello"
> attach to it documents {alias "dx:Users:jd:Documents:c.txt"}
> end tell
>

tell application "Microsoft Entourage"
make new outgoing message at out box folder with properties {account:POP
account 1, subject:"Test", content:"Hello", recipient:{"JD <jd@home>", "JD
<jd@work"}, attachment:{file:alias "dx:Users:jd:Documents:c.txt"}}
end tell

One AppleEvent. You don't even need to specify the account if it's the
default account.

> Cricket says he's sorry to disappoint me and he's not scrapping it
> and starting again. Well so be it. Noone except a lunatic is ever
> going to bother scripting Mail unless the aete is completely
> overhauled by non-aliens. I strongly advise him to reconsider, and
> I'm sure the great majority of the denizens of this list will agree,
> once they've tried working with this appalling mess.

It's a nightmare. Agreed.

--
Paul Berkowitz
_______________________________________________
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.

  • Prev by Date: Re: system rm from Big Cat
  • Next by Date: Re: system rm from Big Cat
  • Previous by thread: Re: Launch Default Mail App attached the file
  • Next by thread: Re: Launch Default Mail App attached the file
  • Index(es):
    • Date
    • Thread