• 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
Is this a major bug or not?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is this a major bug or not?


  • Subject: Is this a major bug or not?
  • From: Deivy Marck Petrescu <email@hidden>
  • Date: Fri, 29 May 2009 10:27:04 -0400

I was writing some scripts for TextEdit and came upon this which I find a problem

Trying this script (one line):

tell application "TextEdit" to tell document 1 to tell its text to return properties of attribute run of word 1

I get this:
-->{{class:text, color:{0, 0, 0}, size:14.0, font:"Verdana-Bold"}}

Notice that this is a list not a record. To get the record I have to refer to item 1 of this list.
I did not remember any other app returning properties like this, so I checked "Mail" to see what it returns for the following script(one line):


tell application "Mail" to tell message 1 of mailbox 1 of account 1 to set pt to (get its properties)

I get this:
-->{content:"If you can't see the images below", was replied to:false, message id:"xxx", reply to:"xxx" , sender:"xxx", mailbox:mailbox "INBOX" of account "deivy" of application "Mail", subject:"xxx", read status:true, was redirected:false, date received:date "Friday, May 29, 2009 9:46:54 AM", source:"Return-Path: ", date sent:date "Friday, May 29, 2009 9:19:24 AM", floating:false, all headers:"From: ", id:11477, was forwarded:false, class:message, message size:10651, deleted status:false, background color:none, junk mail status:false}


Where xxx substitutes the real thing! As I suspected properties should have returned a record not a list.
The propblem is, if I try to get the class of pt (properties) it returns "message"!!!
Even if you try the following after the one line script above:


get class of (pt as record)
--> message

This is a problem. Now pt must be used within a "Mail" tell block to make sense.
If one tries the following after the above script outside the tell block:


was replied to of pt

 one gets an error. That shouldn't be!

So I tried a similar script with a non Apple application, BBEdit.
The following script:

tell application "BBEdit" to tell document 1 to tell its text to set pt to properties
class of pt


---> record

The script returns pt as record and it recognizes it as record.
I think this is a major bug. I do not remember it being discussed here.
Am I alone in my impression?

This should be corrected asap!


Deivy Petrescu 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:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Is this a major bug or not?
      • From: Yvan KOENIG <email@hidden>
  • Prev by Date: Combine multiple PDFs
  • Next by Date: Re: Is this a major bug or not?
  • Previous by thread: Re: Combine multiple PDFs
  • Next by thread: Re: Is this a major bug or not?
  • Index(es):
    • Date
    • Thread