Attack of The Fifty-Foot Homonyms [Re: FileMaker Pro, get image by reference]
Attack of The Fifty-Foot Homonyms [Re: FileMaker Pro, get image by reference]
- Subject: Attack of The Fifty-Foot Homonyms [Re: FileMaker Pro, get image by reference]
- From: has <email@hidden>
- Date: Sun, 24 Nov 2002 22:54:17 +0000
[I think this thread might be better moved to the AS Implementors List to
obtain a suitably succinct and informed answer to the whole mess. Meantime,
here's my suitably verbose and uninformed opinion on it...]
Paul Berkowitz wrote:
>
> tell application "Finder"
>
> activate
>
> copy file "path string" to desktop
>
> end tell
>
>
>
Yes, it must be one of those undocumented Finder coercions.
I don't think it's a coercion. Nor is it something specific to the Finder;
e.g. try Tex-Edit Plus.
I'd guess that some apps, in addition to implementing 'get' and 'set' all
over the place, also choose to implement cousin 'copy'. Looked at like
that, it doesn't seem all that unreasonable.
>
I guess it's doing what it's
>
meant to, which is allowing scripters who don't know the correct syntax
>
(duplicate) to use 'copy',
Yes, it does appear to function a synonym for the 'duplicate' command in
some applications....
>
as in the UI.
...but it's not equivalent to Edit>Copy, as you seem to suggest. The 'copy'
command listed in the application dictionary is the equivalent to
Edit>Copy. And it's a different thing entirely.
So here you have a keyword, 'copy', that's not only a synonym but a homonym
as well. Argh! Does your head hurt too?
>
I suppose they'd have to discover
>
this the hard way when moving to less forgiving apps (i.e. every other app
>
in existence). I imagine this is a very old topic; whether the Finder should
>
provide these lenient coercions to help newbies, or whether it would be
>
kinder to make sure they learn the correct syntax from the beginning.
Again, it's not a coercion, and it's not Finder-specific.
And with AS I think it's very hard to say what is "correct" syntax, simply
because it so often provides more than one way to do something and is
frequently inconsistent about it. It's like some mixture of Python- and
Perl-style philosophies that didn't come out quite right, ending up neither
formal enough to be predictable nor flexible enough that it doesn't matter.
>
it even works in OS 10.2.2, although 'copy' in the Finder
>
Dictionary says :
>
>
copy: (NOT AVAILABLE YET) Copy the selected items to the clipboard (the
>
Finder must be the front application)
>
copy
Unrelated. See above. As the previous poster mentioned, the 'copy' in this
case is the language keyword, not the application keyword. You've been
fooled by 'copy' the homonym. The evil little sod is leering and jeering as
we speak.
(This is why keyword colouring in AS isn't so much a luxury as a necessity:
sometimes it's the only way to work out what's actually happening in the
code.)
>
I find this rather confusing
>
myself, but if it's supposed to be a Good Thing, I guess I can learn it too.
Of course it's not a "Good Thing" - it's badly factored syntax/semantics.
Don't be afraid to call a mess a mess. The language doesn't know if it
wants to share concepts and constructs with applications, or do everything
its own best way. So it ends up being a muddle of both, and everyone gets
confused.
The major problem here is this damn 'copy' language keyword. It should be
eliminated; replaced with 'a copy of' (as in 'set foo to a copy of bar'),
or perhaps 'duplicate' (which has possibilities, but not sure if it's
practical [1]). I don't imagine it'll ever get fixed in AS, but I sincerely
hope it's dead and gone when AS-X rolls around.
Until then, 'duplicate foo to bar' looks a much better option than
inconsistent 'copy foo to bar' in application scripting.
has
[1] But then, it does lead into interesting debates about object
references, which is another major headache inducer... perhaps an
indication that all is not well in that department either.
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
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.