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

Rép: Is this a major bug or not?


  • Subject: Rép: Is this a major bug or not?
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 29 May 2009 21:49:51 +0200

Le 29 mai 2009 à 17:29, Deivy Petrescu a écrit :


On 29/05/2009, at 10:54 , Yvan KOENIG wrote:



Le 29 mai 2009 à 16:27, Deivy Marck Petrescu a écrit :


Yvan, properties are records. So, "return property" should return a record


When I read:

attribute run n [inh. item] : This subdivides the text into chunks that all have the same attributes.

I guess that the item may embed several chunks so, I'm not really surprised to get a list of records.

After all, we may have a color for character 1
an other one for the other characters.

This is a good point, however, if i run

tell application "TextEdit" to tell document 1 to tell paragraph 1 of its text to return attribute run's properties of every character
--->{{{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}, {{font:"Verdana-Bold", color:{0, 0, 0}, class:text, size: 14.0}}}


You see that now we have a list of a list of records.
That does not seem right.

It's perfectly right

You are asking for the attribute run of a list of elements (the characters) so you get a list of attributes run because as I explained, the tool build a list for every analyzed item.

If you ask for the attributes of one item as I does with this script:

tell application "TextEdit" to tell document 1 to tell paragraph 1 of its text to return attribute run's properties of word 2
on a text whose word 2 of paragraph 1 has first letter in size 24 and others in size 12,


The log report is logically:

tell application "TextEdit"
get properties of attribute run of word 2 of paragraph 1 of every text of document 1
{{size:24.0, color:{0, 0, 0}, font:"Helvetica", class:text}, {size: 12.0, color:{0, 0, 0}, font:"Helvetica", class:text}}
end tell


In fact it's the same behavior than choose file since we may select several files.

Yvan KOENIG (from FRANCE vendredi 29 mai 2009 21:00:42)




_______________________________________________ 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: Combine multiple PDFs
  • Next by Date: Re: Combine multiple PDFs
  • Previous by thread: quicktime player: get starttimecode
  • Next by thread: Re: AppleScript-Users Digest, Vol 6, Issue 241
  • Index(es):
    • Date
    • Thread