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

Re: Scripting Mail App


  • Subject: Re: Scripting Mail App
  • From: Daniel Jalkut <email@hidden>
  • Date: Mon, 2 May 2005 10:10:35 -0700

Hi John - it looks like a bug to me. Either that or Mail has a different concept of what "filed mailbox" is than you or I do.
I just tried the important part of your script on a message in one of my mail folders, and got the same failure. How to debug? It helps to pinpoint where the failure is happening and then start reducing the script line bit by bit until you get an object that you expect to have the property. Then you can ask for the properties of the object by name, sometimes. In this case:


tell application "Mail"
    set myMessages to the selection
    return properties of (item 1 of myMessages)
end tell

This shows a bunch of information, including the fact that the mailbox property is "missing value". This is probably related to the fact that if you ask for "mailboxes" you get a list of mailboxes that is probably much shorter than you are expecting.

I don't know of a workaround, but it seems like you're doing it the "right way" but Mail is just busted in this regard.

Daniel


On May 2, 2005, at 8:37 AM, John Clark wrote:

I am starting to do some applescripting again (I used to do scripting
under OS 8 so yes, it's been a while). I am running into some
conceptual issues. It seems to me like the following should work:

tell application "Mail"
    set myMessages to the selection
    set myDate to date received of item 1 of myMessages
    set myMonth to month of myDate
    set myYear to year of myDate
    set MyMbxName to name of mailbox of item 1 of myMessages
    display dialog "mailbox is " & MyMbxName & " :" & myMonth & " " &
myYear as text
end tell

But it doesn't and I can't figure out why. Setting just the date
works, but the name of the mailbox seems to give this fits. Is there
any way to see debug info? Right now it just flashes at me and does
nothing.

Where am I going wrong?

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


This email sent to email@hidden


_______________________________________________ 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
  • Follow-Ups:
    • Re: Scripting Mail App
      • From: John Clark <email@hidden>
References: 
 >Scripting Mail App (From: John Clark <email@hidden>)

  • Prev by Date: RE: Need help with MS Word 2004 languages and dictionaries
  • Next by Date: Image Events and Unicode
  • Previous by thread: Scripting Mail App
  • Next by thread: Re: Scripting Mail App
  • Index(es):
    • Date
    • Thread