Re: scripting mail to select mailboxes
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.