Please explain this!? More....
Please explain this!? More....
- Subject: Please explain this!? More....
- From: Harald E Brandt <email@hidden>
- Date: Fri, 23 Nov 2001 14:07:37 +0100
Quote from AppleScript Language Guide:
"The value of an Every Element reference is a list of the objects in the container."
Now try:
tell application "Finder" to class of (every file in control panels folder)
-- {application file, control panel, control panel, control, control, control, <and many more>}
The above violates AppleScript Language Guide!? It' not class list!
What are those braces?
The result of Every Element is thus not a list but a new, to me unknown, class. (Set of classes?)
Compare with:
tell application "Finder" to class of ((every file in control panels folder) as list)
-- list
Which is what I expected from the first statement. It can also be done with:
tell application "Finder" to class of (get every file in control panels folder)
-- list --(i.e that 'get' changed it all somehow!?)
I CAN do:
tell application "Finder" to name of ((folders whose name starts with "a") in extensions folder)
-- "ActiveX Controls"
I can also do:
tell application "Finder"
set name of ((folders whose name starts with "a") in extensions folder) to "NiceTry"
end tell
But I CANNOT do:
tell application "Finder"
set f to ((folders whose name starts with "a") in extensions folder)
set name of f to "NiceTry"
end tell
--Yields error!
???
With semantics like this, I can't program!!
______heb________________________________________________________________
Harald E Brandt email@hidden PGP/MIME aware
http://heb.bragit.com