• 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: Mail question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail question


  • Subject: Re: Mail question
  • From: Andrew Oliver <email@hidden>
  • Date: Mon, 24 Jan 2005 21:01:26 -0800

On 1/24/05 8:35 PM, "Rob Lewis" <email@hidden> wrote:

> I'm new at scripting Mail and I understand it's quirky, but this?
>
[snip]
> 4. But run this:
>
> tell application "Mail" to get (item 1 of the selection)  --(with or
> without parens)
>
> returns an error message: "Mail got an error:
> NSCannotCreateScriptCommandError"
>
> The command to get item 1 of a list fails?!

It's a common problem when dealing with selections. I forget the exact
reasoning (Emmanuel can probably post a link). The upshot is that you need
to get selection independently of referencing items within it.

You should find that:

 tell application "Mail" to get (item 1 of (get selection))

will work.

One of several gotchas.

Andrew
:)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Mail question (From: Rob Lewis <email@hidden>)

  • Prev by Date: Mail question
  • Next by Date: Image Capture
  • Previous by thread: Mail question
  • Next by thread: Re: Mail question
  • Index(es):
    • Date
    • Thread