• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: OSAX within tells(Keyboard Question?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OSAX within tells(Keyboard Question?)


  • Subject: Re: OSAX within tells(Keyboard Question?)
  • From: Phi Sanders <email@hidden>
  • Date: Wed, 17 Jan 2001 22:56:32 -0500

Ahhh, I see what your saying...

Don't put OSAX calls OUTSIDE tell blocks if you are in the middle
of telling an application some multi-step task

tell app "foo"
do this
--the next call is to an osax
do osaxthing
-- now "tell" to "foo" some more
do that
end tell

as oppossed to :

tell app "foo"
do this
end tell

--the next call is to an osax
do osaxthing
-- now "tell" to "foo" some more

tell app "foo"
do that
end tell


And I agree with you there.

(I thgought you meant to ALWAYS do OSAX calls in a tell bloc, that'd be
wrong...)

~Phi
--
Phi Sanders
"Phee, Phi, Pho, Phum..."

"And now, back to your regularly scheduled reality."

On 1/17/01, email@hidden {email@hidden} said the
following :

>>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
>_______________________________________________
>applescript-users mailing list
>email@hidden
>http://www.lists.apple.com/mailman/listinfo/applescript-users


References: 
 >Re: OSAX within tells(Keyboard Question?) (From: email@hidden)

  • Prev by Date: Re: OSAX within tells(Keyboard Question?)
  • Next by Date: FIXED! - Help: using "record" freezes/crashes my G4
  • Previous by thread: Re: OSAX within tells(Keyboard Question?)
  • Next by thread: Variable script behaviour
  • Index(es):
    • Date
    • Thread