• 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: scripting mail to select mailboxes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scripting mail to select mailboxes


  • Subject: Re: scripting mail to select mailboxes
  • From: cricket <email@hidden>
  • Date: Thu, 13 Mar 2003 11:03:02 -0800

If you look at an application's dictionary and learn it's containment hierarchy (and they all have them), you MUST follow it. That is the way Applescript works. It is 100% strict about this. You can't even specify absolute paths. For example, I couldn't do this:

tell app "Mail"
tell message viewer 1
set theMailbox to mailbox "Foo" of account "Bar" of application "Mail"
end tell
end tell

I don't think you're being cantankerous, just incorrect. An application can define any containment hierarchy you want (or not have one at all, putting everything into the application class), but as a scripter writing scripts, you have to follow what the application specifies or your script will not work.

- cricket

On Wednesday, March 12, 2003, at 10:45 PM, Jon Pugh wrote:

At 2:18 PM -0800 3/12/03, cricket wrote:
Applescript is strict about containment hierarchy.

Not to be cantankerous or anything, but AppleScript is *not* strict about containment. The applications are. AppleScript will allow any old containment hierarchy you specify, which was the error that prompted this comment.

You can nest any tell statements you want, or build any object specifier you can imagine and AppleScript will gladly comply. However, the application you are telling may complain at run time if the object specifier is ill formed. This is not AppleScript's doing.

In fact, it is possible for applications to be less strict by supporting shortcuts. For example, if an application could only ever have one document, it might allow document references, but also allow document properties to be accessed from the application object, just for ease of use. Then "foo" and "foo of document 1" would both work. Most applications don't do this, but they could, and AppleScript would let them.

----->
Software Entomologist  Mail for Mac OS X
http://www.apple.com/macosx/jaguar/mail.html
---------->
It's much easier to hug people when they hug back.
_______________________________________________
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.

  • Follow-Ups:
    • Re: scripting mail to select mailboxes
      • From: Jon Pugh <email@hidden>
References: 
 >Re: scripting mail to select mailboxes (From: "David P. Baker" <email@hidden>)
 >Re: scripting mail to select mailboxes (From: cricket <email@hidden>)
 >Re: scripting mail to select mailboxes (From: Jon Pugh <email@hidden>)

  • Prev by Date: Re: scripting mail to select mailboxes
  • Next by Date: Re: Running external script from Mail.app
  • Previous by thread: Re: scripting mail to select mailboxes
  • Next by thread: Re: scripting mail to select mailboxes
  • Index(es):
    • Date
    • Thread