Re: Quick Finder Question
Re: Quick Finder Question
- Subject: Re: Quick Finder Question
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 14 Sep 2003 12:28:31 -0700
On 9/14/03 11:29 AM, "Richard Fairbanks" <email@hidden> wrote:
>
>> Manual. How can one tell when it's necessary to use one class to call
>
>> another?
>
>
>
> AppleScript is fairly object-oriented:
>
>
<snip>
>
>
Paul, thank you for your lengthy (and patient) explanation. The kindness of
>
the folks on this list for those of us in the throes of scaling AppleScript's
>
learning curve is humbling.
You're welcome. I must say that I find it almost impossible to send anything
to this list without some error that I (or someone else) have/has then to
correct. So that's humbling, too. ;-) I included at least one such error
here, in an aside:
>
OK, now you know to look for a 'list view options' class. Unfortunately it's
>
not in the same suite but if you peruse the whole list of suites and classes
>
you will indeed find such a class in the Type Definitions class and there,
>
sure enough, is 'column' as an element. Since it's an element, not a
>
property, column should in fact have an entry of its own as a class, I
>
think. I don't know why it doesn't: I think that may be a bug in the Finder
>
dictionary. Presumably it's allowed because it has no properties of its own:
>
if you look at how it can be specified, there is no mention of 'by name'
>
since it would have to be a class with a 'name' property to be specified by
>
name. The other specifications: by numeric index, before/after another
>
element, as a range of elements, satisfying a test - can apply without it
>
having any of is own properties or elements. Still, I think it _should_ have
>
its own class entry and a name property.
Of course 'column' IS in fact a class in that same 'Type Definitions' suite,
and does have a 'name' property, amongst several others:
Class column: a column of a list view
Plural form:
columns
Properties:
index - integer -- the index in the front-to-back ordering within its
container
name - name column/modification date column/creation date column/size
column/kind column/label column/version column/comment column [r/o] -- the
column name
sort direction - normal/reversed -- The direction in which the window
is sorted
width - small integer -- the width of this column
visible - boolean -- is this column visible
I don't know how I missed that. I think you had already found the column
class yourself, since you had referred to it that way in your question.
Apologies for the red herring.
You'll notice that the name property of column is read-only [r/o] and
restricted to the enumerations listed ( name column/modification date
column/creation date column/size column/kind column/label column/version
column/comment column ) - and not something you change yourself. It's just
the names (and thus the list of columns to choose from) which are read-only,
and the way columns are referred to is a little peculiar. You have to
specify a particular Finder window to get its list view options, although I
think they're all the same:
get every column of list view options of Finder window 1
--> {column id name column of list view options of Finder window id 3,
column id modification date column of list view options of Finder window id
3, column id creation date column of list view options of Finder window id
3, column id size column of list view options of Finder window id 3, column
id kind column of list view options of Finder window id 3, column id label
column of list view options of Finder window id 3, column id version column
of list view options of Finder window id 3, column id comment column of list
view options of Finder window id 3}
'column id name column' -- odd.
To find out which are actually "in place" for a particular Finder window,
you need to get the ones whose visible is true:
get every column of list view options of Finder window 1 whose visible
is true
--> {column id name column of list view options of Finder window id 3,
column id modification date column of list view options of Finder window id
3, column id size column of list view options of Finder window id 3, column
id kind column of list view options of Finder window id 3}
And this 'visible' property is not r/o: you can set it. That's how to change
the columns - one window at a time, or even for all _open_ Finder windows:
tell application "Finder"
set visible of column id size column of list view options of every
Finder window to false
end tell
But I don't see any way to change the Finder's view preferences (as in
View/Show View Options) to ensure that Finder windows you open in the future
will not have a Size column (equivalent to "All Windows" in those Options).
I see that there's a 'preferences' class in that suite, not yet implemented:
Class preferences: (NOT AVAILABLE, SUBJECT TO CHANGE) The Finder Preferences
but even that class does not have its own 'list view options' property,
which seems to be a gap, although it has all the other properties you'd
expect. Unless I've missed something. Maybe when it's implemented they can
add a 'list view options' and 'icon view options' property.
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.