• 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: I would appreciate help with this one.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I would appreciate help with this one.


  • Subject: Re: I would appreciate help with this one.
  • From: Axel Luttgens <email@hidden>
  • Date: Tue, 1 Sep 2009 10:00:05 +0200

Le 1 sept. 09 à 01:23, R. Nelson Byrne a écrit :

tell application "Mail"
get properties of mailbox "Business" -->{account:missing value, class:mailbox, unread count:0, container:account "On My Mac" of application "Mail", name:"Business"}
get class of (container of mailbox "Business") -->mailbox
(*
little problem, the class should be account, no?

No... ;-)

According to Mail's dictionary, the container of a mailbox, if any, is a mailbox.
In that sense, having the class returned as mailbox seems to be consistent.


The problem is with that elusive thing, that
account "On My Mac"
It isn't an account (see above), nor is it a well-behaved object (see your result hereafter).


I guess your mailbox "Business" is a local one, created at the top- level?
Strictly speaking, it thus hasn't a container, and its container property should return missing value.
See for example those top-level mailboxes maintained by the application itself and made available thru application properties (sent mailbox, outbox, inbox...):
tell application "Mail" to get container of outbox
--> missing value



OK, let's redo this except refer to it via a variable
*)
get (container of mailbox "Business") returning account_business -- >account "On My Mac" of application "Mail"
try
get class of account_business
on error class_errormess number class_error_numb
log class_errormess & " Number " & class_error_numb as text-- >(*Mail got an error: Can’t get account "On My Mac". Number -1728*)
end try
(*
Now we get an error instead of a wrong answer!
*)
end tell

I suspect that
account "On My Mac"
thing to be a bug, perhaps a leftover of some aborted attempt to integrate the "On My Mac" concept into the scripting model.



Running 10.5.8 on a Dual 2 GHz PowerPC G5 (remember that machine? remember that OS version?)

Yes and yes. :-)

Axel

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Prev by Date: Re: Here is an example of the weird character thing.
  • Next by Date: Re: Weird Characters
  • Previous by thread: Re: Here is an example of the weird character thing.
  • Next by thread: Re: Weird Characters
  • Index(es):
    • Date
    • Thread