Re: OSAX within tells(Keyboard Question?)
Re: OSAX within tells(Keyboard Question?)
- Subject: Re: OSAX within tells(Keyboard Question?)
- From: email@hidden
- Date: Wed, 17 Jan 2001 19:23:09 -0800
>
IMHO it's a worse idea to try to write scripts with Osax calls outside of
tell blocks.
>
>
>>>Umm.... Why?
Because it clutters up and breaks up perfectly readable and understandable
AppleScripts for no good reason.
And that makes scripting more complex and tedious and harder to learn.
It also prevents you from using a wide range of compound commands like:
set the name of myFile to date string for (current date)
In the keyboard example given there is no reason not to use ASCII Character
or ASCII Number commands within a finder tell or a quark tell or
Photoshop/PhotoScripter tell. It doesn't significantly impact processing
time (and in some cases may even be slightly faster.) I haven't heard of a
single bug with either of those or with most of the commonly used OSAX
commands or even with any of the more rare ones.
Including OSAX commands within application tells is not a "bad habit".
It's using the technology the way it was designed. I believe that all the
AppleScript books agree and nearly every sample script from Apple that I've
seen uses them.
Now, I'm not saying there is anything wrong with moving commands outside
tells if your more comfortable with that and prefer that, but I am saying
we should not tell Scripters, particularly new Scripters, that it's a
problem when it's not.
ES