Re: Finder Scripting
Re: Finder Scripting
- Subject: Re: Finder Scripting
- From: Shane Stanley <email@hidden>
- Date: Sat, 20 Aug 2005 22:17:35 +1000
- Thread-topic: Finder Scripting
On 20/8/05 10:12 AM, "Dave Lyons" <email@hidden> wrote:
> On Aug 19, 2005, at 3:11 AM, Shane Stanley wrote:
>> Have a look at the dictionary: there's actually a command that
>> includes the words "(NOT AVAILABLE)" in the command itself.
>
> There are actually 10 of those remaining (in the descriptions, not in
> the actual names of the commands and properties).
According to the dictionary, one command is "(NOT AVAILABLE) add to
favorites". But now I try it, I see it doesn't actually compile like that.
Then again, "add to favorites" alone won't compile either. (If I enter
"«event fndrffav»" it compiles to "(NOT AVAILABLE) add to favorites" once,
but from then on refuses to compile.)
> I'm not happy
> about them, but they are there on commands and properties that worked
> in Mac OS 9, where removing them entirely would have made it
> impossible to compile e a script that (does version checking and)
> works on both Finder 9 and Finder X.
It's hard to argue against backwards compatibility, but let's be realistic:
we're on the _fifth_ major OS release since OS 9. People saw "not available
*yet*" in 10.0 and said, fair enough, but it's been there in four major
releases since. I think people can be forgiven for being a bit peeved.
Moreover, we're not really talking about a script that "works on both Finder
9 and Finder X" -- the whole point is that these things _don't_ work under
Finder X. Whatever, I'm not sure that there are many people still writing
scripts for both. Brave souls.
>> Who can keep track of which versions have "duplicate ... with
>> replacing" broken and which have "move ... with replacing" broken?
>
> The details don't spring to mind here, but there seem to be no open
> Radar bugs in this area. If something is still broken, please let me
> know.
Somewhere in the 10.3.x range, the command "move <multiple files>...with
replacing" would error if more than one file needed to be replaced. The
workaround was to duplicate then replace. In Tiger, the situation is
reversed; you can move but not (always) duplicate. The problem doesn't
happen always, but when it does you see an error dialog quickly flash up
("Sorry, the operation could not be completed because an unexpected error
occurred, (Error code 0)"). The script editor's log records no error; in
fact, the command returns what would be the result of correct operation.
(This makes trapping it a nightmare.)
The result of this sort of history is that people start using shell scripts
more. Maybe that's a good thing. But it all goes to make AppleScript less
approachable to the beginner.
>> The current version of recording is pretty entertaining, too.
>
> It went from "none" up to 10.2, to "some" in 10.3, and then "some
> more" in 10.4. Is it entertaining because you have to guess whether
> a given operation will record or not, or is something full-on
> broken? The only open Recording bug is that closing certain kinds of
> windows records the operation twice in a row.
The big thing missing is the recording of moving anything. Move a file, you
get "select Finder window 1". Delete a file, you get "select Finder window
1". Duplicate a file, you get "select Finder window 1". You can do a whole
lot of actions, and all you end up with is a series of "select Finder window
1/select Finder window 1/select Finder window 1".
In truth, I see recordability as a much lower priority than having other
stuff working. Recordability with such big gaps seems like effort that could
have been better expended elsewhere (although realistically I assume it's a
work-in-progress as time permits).
I guess my feeling is that the Finder should be a good place for people to
learn AppleScript -- everyone has it, uses it, and knows how it works. As it
stands, it tends to be a good example for the wrong reasons. Things like "as
alias list" and the error it gives when there's only one item -- it's been
around since what, 8.6?
--
Shane Stanley <email@hidden>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden