Re: Quick Finder Question
Re: Quick Finder Question
- Subject: Re: Quick Finder Question
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 12 Sep 2003 15:22:33 -0700
On 9/11/03 4:21 PM, "Richard Fairbanks" <email@hidden> wrote:
>
>
The solution, as pointed out by Andrew, is:
>
>
set the width of column name column of the list view options of window x to y
>
>
Here's where my error appeared. I didn't know that I had go through the class
>
"list view options" to get to the class "columns" and I had spent a good
>
amount of time pouring through the Finder dictionary and the AS Reference
>
Manual. How can one tell when it's necessary to use one class to call another?
AppleScript is fairly object-oriented: every term that's not a command is
either an element (one of many) or a property (particular attribute) of a
some other object (class). An element must be a member of its own class, so
that class will be listed A property can be "anything" - a string, a list, a
record, a constant defined by the application, or a member of one of the
application's classes (just like an element). Or more I've left out.
What you're looking for (a column) seems to have something to do with
windows = perhaps they're elements of a window? We check 'window', and
there's nothing that looks remotely applicable. But just below 'window' is
'Finder window' - which must be a special sort of window and different from
'information window', 'preferences window' and 'clippings' window, also
listed. (You might think that any window in the Finder would be a 'Finder
window', but presumably it means the 'regular Finder window' representing
the contents of a container - a folder or disk. And so it proves.
So we look for 'column' as an element of 'Finder window'. But it's not
there. Probably because a Finder window in icon view has no columns, so it
can't really be an element of a Finder window per se - it relates somehow to
how we're viewing the window , our view choice. Maybe there's something
about that. Sure enough, at the bottom of its properties come three which
don't belong to the 'generic' window in the Standard Suite:
current view - icon view/list view/column view -- the current view for
the container window
icon view options - icon view options [r/o] -- the icon view options
for the container window
list view options - list view options [r/o] -- the list view options
for the container window
The last one evidently represents the options available only to list view,
not icon view. ('column view' doesn't appear to have any options: it just
"is"). We see (hard to tell in this plain text email copy but more obvious
in the styled dictionary) that the second segment of text, which tells us
the class of the property - uses exactly the same words as the name of the
property itself - namely 'list view options'. Depending on how you look at
it, that's an unfortunate use of words confusing the property name with a
class name, or fortunate in that it makes very clear what it is. Since 'list
view options' is not a class you come up against much - not like 'string' or
'Unicode text' or 'list' or 'record - chances are that it's not an
AppleScript lass but another Finder class (it can only be one or the other
since it's in the Finder dictionary). And don't be alarmed by the '[r/o]':
that simply means that you can't yourself determine what these various
options might be - they're a given - you can't decide that you'd like to set
a window's list view options to "cherry, banana, and file" for example.
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.
As boo says, the "Explorer" panel of Script Debugger might get you there
more quickly if you start by opening the disclosure triangle for a window.
--
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.