On Apr 8, 2010, at 9:26 AM, Yvan KOENIG wrote: I guess that it's linked to the class of the properties 's names. Here I pasted the record grabbed by the set propRec to (system info) -- from StandardAdditions instruction. I just changed some values in this message
Very interesting. I tried the following: First, this ...
set itemAlias to alias "OS_X:Users:lutherfuller:Desktop:untitled" -- for example tell application "Finder" set propRec to properties of item itemAlias log propRec end tell
Then, I copied from Smile's console into a script, twice, getting ...
{ class:« class docf», name:"untitled", index:60, displayed name:"untitled", name extension:"", extension hidden: false, « class ctnr»:« class cfol» "Desktop" of « class cfol» "lutherfuller" of « class cfol» "Users" of « class sdsk», « class cdis»:« class sdsk», « class posn»:{-1, -1}, « class dpos»:{1286, 784}, bounds:{-33, -33, 31, 31}, kind:"script document", « class labi»:0, locked: false, « class dscr»: missing value, « class comt»:"", size:4316, « class phys»:8192, creation date: date "Thursday, March 25, 2010 5:19:46 PM", modification date: date "Thursday, March 25, 2010 5:55:01 PM", « class iimg»: missing value, URL:" file://localhost/Users/lutherfuller/Desktop/untitled", « class sown»:"lutherfuller", « class sgrp»:"wheel", « class ownr»:« constant ****rdwr», « class gppr»:« constant ****read», « class gstp»:« constant ****read», file type:"osas", creator type:"VIZF", « class pspd»: false, « class ver2»:"", version:""}
tell application "Finder" { class: document file, name:"untitled", index:60, displayed name:"untitled", name extension:"", extension hidden: false, container: folder "Desktop" of folder "lutherfuller" of folder "Users" of startup disk, disk: startup disk, position:{-1, -1}, desktop position:{1286, 784}, bounds:{-33, -33, 31, 31}, kind:"script document", label index:0, locked: false, description: missing value, comment:"", size:4316, physical size:8192, creation date: date "Thursday, March 25, 2010 5:19:46 PM", modification date: date "Thursday, March 25, 2010 5:55:01 PM", icon: missing value, URL:" file://localhost/Users/lutherfuller/Desktop/untitled", owner:"lutherfuller", group:"wheel", owner privileges: read write, group privileges: read only, everyones privileges: read only, file type:"osas", creator type:"VIZF", stationery: false, product version:"", version:""} end tell
Notice the difference. It seems that only the Finder knows how to understand the names and values in the record. Outside a 'tell application "Finder" ' block, the record is meaningless. For example ...
log (position of testRec)
works properly within the block, but errors if outside the block.
It seems that a 'property record' "belongs to" a particular application and is not understandable in another application or AppleScript.
|