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

Re: Is this a major bug or not?


  • Subject: Re: Is this a major bug or not?
  • From: Yvan KOENIG <email@hidden>
  • Date: Sun, 31 May 2009 17:25:55 +0200


Le 31 mai 2009 à 16:50, Deivy Marck Petrescu a écrit :


On May 31, 2009, at 10:34, Yvan KOENIG wrote:

tell application "AppleWorks 6"
set props to (get properties of document 1)
log class of props
end tell



Yvan,
the only problem is your insistence in using Apple Apps.
AppleWorks is a subsidiary. TextEdit and Mail are Apple's.
If you use another application it really returns what g is, a record:

tell application "BBEdit"
set props to (get properties of document 1)
log class of props
end tell

Log:
tell application "BBEdit"
get properties of document 1
{id:1358154, container:current application, modified:true, modifiable:true, modification date:date "Sunday, May 31, 2009 10:42:17 AM", name:"untitled text", on disk:false, file:missing value, creator type:"R*ch", window:text window 1, container web site:missing value, text encoding:"Unicode™ (UTF-8, no BOM)", FTP Info:missing value, is FTP:false, line breaks:Unix, source language:"(none)", state modified:false, URL:missing value, contents:""
(*record*) <------ see!
end tell



I'm not insisting on Apple apps behavior.

In your example with BBEdit, the returned record doesn't contain a class property so when you ask for the clas of the record, you get the class of the item
{id:1358154, 
container:current application, 
modified:true, 
modifiable:true, 
modification date:date "Sunday, May 31, 2009 10:42:17 AM", 
name:"untitled text", 
on disk:false, 
file:missing value, 
creator type:"R*ch", 
window:text window 1, 
container web site:missing value, 
text encoding:"Unicode™ (UTF-8, no BOM)", 
FTP Info:missing value, 
is FTP:false, 
line breaks:Unix, 
source language:"(none)", 
state modified:false, 
URL:missing value, 
contents:""}

BUT

when a class property is embedded in the record, it's this one which is logically returned.

AppleWorks returns this record:

{class:text document,   (means that the record contains the properties of a Text Document item )
name:"sans titre", 
index:1, 
modified:true, 
title:"", 
margins:{72, 72, 72, 72}, 
author:"", 
version:"", 
keywords:"", 
category:"", 
description:"", 
autohyphenate:false, 
file:false, 
merge file:false, 
date format:numeric date, 
fractional character widths:false, 
smart quotes:true, 
side handles:true, 
polygon autoclose:false, 
show invisibles:false, 
smooth fonts:true, 
word wrap:true, 
autosmooth:true, 
shift constraint:45}

TextEdit returns this one:

{size:10.0, 
color:{0, 0, 0}, 
font:"Monaco", 
class:text}  (means that the record contains the properties of a Text  item )

I don't know if non-Apple apps returns a class property in their records.
I know that Apple ones are doing and that the behavior is perfectly logical.

Priority is given to the properties embedded in the records.

So, when we ask for the class of aRecord,

when aRecord contains a class, we get this one : text for TextEdit,  text document for AppleWorks.
when aRecord doesn't contain a class, we get the class of the object aRecord itself: record for BBEdit.

Yvan KOENIG (from FRANCE dimanche 31 mai 2009 17:24:08)
 _______________________________________________
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

References: 
 >Re: Is this a major bug or not? (From: "Nigel Garvey" <email@hidden>)
 >Re: Is this a major bug or not? (From: Deivy Petrescu <email@hidden>)
 >Re: Is this a major bug or not? (From: Yvan KOENIG <email@hidden>)
 >Re: Is this a major bug or not? (From: Deivy Marck Petrescu <email@hidden>)

  • Prev by Date: Re: Is this a major bug or not?
  • Next by Date: Re: Is this a major bug or not?
  • Previous by thread: Re: Is this a major bug or not?
  • Next by thread: Re: Is this a major bug or not?
  • Index(es):
    • Date
    • Thread