• 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: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful)


  • Subject: Re: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful)
  • From: Doug McNutt <email@hidden>
  • Date: Thu, 18 Dec 2008 10:32:51 -0700

At 08:55 -0800 12/18/08, John C. Welch wrote:
Because if that's what you want, you should use those (other languages) instead? AppleScript
is AppleScript. Just like English isn't Chinese, Farsi, Portuguese, or
Spanish, AppleScript isn't a lot of other languages. "Not being something
else" is never a definition of "bad".

AppleScript is pretty much the only way to access capabilities of GUI applications written for Macintosh.


Those "other" scripting languages mostly have a way to get to AppleScript for the purpose of getting something done that normally requires human action. If there isn't a specialized interface to AppleEvents in the language it surely has an escape-to-shell capability. Once you do that you can use the osascript and osacompile UNIX tools that will compile an AppleScript on the spot and run it.

Yes, that's a slower way to do things, but scripting languages were never built for speed and AppleScript by itself will never compete with a compiled application for speed.

What's hard is creating an AppleEvent and sending it to an application without the help of AppleScript. There the problem is extracting the needed command codes from the application. Script Editor's dictionary processing is pretty much all you get though there have been some conversions of aevt resources to the likes of HTML around.

Figuring out just how to phrase the English text will forever remain a PITA. The best way by far is to ask on this list and someone will help you. Just have a look at the archives and be careful about making your problem clear. Wouldn't a man page for AppleScript with a whole lot of examples be nice?

As for the do Shell Script command, there is a problem. The bash shell is executed on a one-time basis and doesn't even run your startup scripts. The shell has no memory of environment variables save those that are read from $HOME/.MacOSX/environment.plist at login time. If you tell application "Terminal" to do script *** in window "yourchoice" you will be able to see the stdout and stderr data as well as being able to set variables and have them remembered.

--

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful)
      • From: Chris Page <email@hidden>
    • Re: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful)
      • From: "John C. Welch" <email@hidden>
References: 
 >Re: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful) (From: "John C. Welch" <email@hidden>)

  • Prev by Date: Re: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful)
  • Next by Date: Re: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful)
  • Previous by thread: Re: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful)
  • Next by thread: Re: on neophytes vs perfectionists (was Re: Tell Blocks Considered Harmful)
  • Index(es):
    • Date
    • Thread