osax Terminology (was Re: timing scripts)
osax Terminology (was Re: timing scripts)
- Subject: osax Terminology (was Re: timing scripts)
- From: email@hidden
- Date: Thu, 18 Jul 2002 22:54:43 -0400
On Thu, 18 Jul 2002 15:02:23 +0100, has <email@hidden> asked,
>
Out of interest, if an osax command begins with a word that has
>
existing meaning, how does the AS compiler handle that? e.g. If
>
I wrote an osax that had the command "log special", will the
>
parser recognise that as the 'log' command followed by some
>
unknown keyword or variable 'special', or is it "greedy" in that
>
it'll recognise the two-word command over the one-word one? [I
>
hope that makes sense.] I know this is kinda playing Devil's
>
Advocate here, and it's not an issue that affects me directly
>
(not for now, anyway), but perhaps some of the problem is with
>
osax/app authors not knowing what is/isn't a safe way
>
to phrase commands.
Its easy to test it yourself: Take a random osax, preferably one
that is not key to your productivity, income, or personal fulfillment.
I took GTQ's "play sound" as an example. Open it with ResEdit, open
the osax's 'aete' resource, drill down to its events, and change
"play" to "log special". Save, close, reboot, and try 'log special
sound "Sosumi"' It plays the sound.
To make it clear that "log special" and "log" don't interfere, try
this script:
log special sound "ChuToy"
log "Hello, world!"
--------------------------
| - Event Log -
--------------------------
| tell current application
| log special sound "ChuToy" [squeek-squeek!]
| (*Hello, world!*)
| end tell
Now, if you were to define a class "special sound" in an osax,
I won't predict which way the phrase "... log special sound... "
would parse. I leave that as an exercise for the student.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden
_______________________________________________
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.