Re: Set visible
Re: Set visible
- Subject: Re: Set visible
- From: Paul Berkowitz <email@hidden>
- Date: Fri, 16 Aug 2002 14:14:46 -0700
On 8/16/02 1:14 PM, "Doug McNutt" <email@hidden> wrote:
>
At 12:12 -0700 8/16/02, Paul Berkowitz wrote:
>
> Set it to what? If it _did_ have a 'visible' property
>
>
>
> The question is: do you know about application dictionaries,
>
>
AppleScript is advertised by Apple to be a "natural English", "for the rest of
>
us", scripting language.
And so it is, more or less. That doesn't mean you can write anything in
English - say a sentence by Jane Austin - and expect it to work! It just
means that IF a command or property has been implemented, it will be be
something along the lines of
set visible of something to true
rather than
setfile -a v "{path to file}"
or
-a v = 1
>
Sherlock, also provided by Apple, defines a "visible"
>
property for files and folders. The visible property exists in the OS it's a
>
bit in the finder info section of the directory entry.
I don't know of a finder info section.
Look, I agree that it might be a good thing for Finder folders to have a
settable 'visible' property, or at least a r/o 'visible' property, but it
doesn't. In fact, the Finder doesn't see invisible folders at all, so you
can just take it that all folders the Finder recognizes as folders are
visible. (In OS X, certain special invisible folders, such as the temporary
items folder - gettable as an alias by the Standard Additions 'oath to
temporary items' - are acknowledged by the Finder as 'item', NOT 'folder'.)
The fact that SOME objects have 'visible' property does not mean that every
object does. Just check the Dictionary, and it will tell you whether it does
or it doesn't. That's not so difficult. You can certainly make a feature
request for Finder 'file' and 'folder' to have a settable 'visible'
property. My guess is that way back when someone decided that the Finder
AppleScripting should only make available what is visible in the UI, not
what the underlying file system has as invisible items.
>
The problem is that the
>
Script Editor doesn't recognize it. I remember a "visible" property from
>
Hypercard though it was for buttons and not for files.
Ad there's a 'visible' property for 'process' in the Finder, but not for
files or folders.
>
>
It is unfair to flame a user of AppleScript for trying a term which Apple uses
>
all over the place. 99% of learning AppleScript is trying things out. That
>
ought to be encouraged.
What ought to be encouraged is reading Dictionaries to understand what you
can script and what you can't. It's not only fair, but also wise, to point
that out. I'm sorry if it came out as brusque. I think it would be the very
worst possible thing to encourage new scripters to imagine that they can use
non-existent properties of objects because they happened to run into the
term somewhere else. They're never going to learn anything that way, and
their scripting will be forever hampered and lame. I'm sorry, but that would
be just plain dumb. Why bother to have an AS-Users mailing list at all in
that case?
>
>
setfile -a V "{path to file}" # makes it invisible
>
setfile -a v "{path to file}" # makes it visible
>
That's using Apple's MPW command line interpreter which is no longer available
>
in OS neXt.
>
>
The question is just how does one set or clear the visible attribute from
>
AppleScript? Perhaps a tell block addressed to Sherlock?
No. Shell scripting in what you insist on calling "OS Next" can do it. See,
scripting has improved in OS X: it doesn't confine you Finder (UI-visible)
scripting. You can't do it in OS 7, 8, 9 except with a 3rd-party osax:.
Akua Sweets' 'set catalog info'.
--
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.