Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

merlyn (47)

merlyn
  merlyn@stonehenge.com
http://www.stonehenge.com/merlyn/
AOL IM: realmerlyn (Add Buddy, Send Message)
Yahoo! ID: realmerlyn (Add User, Send Message)

PAUSE-ID: MERLYN [cpan.org].
See my home page [stonehenge.com].

Journal of merlyn (47)

Sunday January 26, 2003
12:15 PM

So called "programming" with AppleScript

[ #10195 ]
I just finished ranting for about an email page's worth on the AppleScript developers mailing list about the frustrations that I have every time I attack an AS problem, even being a 30-year veteran programmer.

In formulating my thoughts, three major points came out:

  • The datatypes in AS are complicated, especially around "naming something on disk", because there's a lot of legacy that has to be included and supported. And then they threw Unicode on top of that.
  • Much of the higher-level filtering and list wrangling for domain-level data must be implemented in the application space by including the proper programming or libraries. If a particular application leaves it out, or uses older libraries, a pattern I learned with one data set won't work with another, simply because the application doesn't include support for that filtering. The workaround is to first try it, and if it fails, bring the entire data over to the applescript runner app instead of leaving it in the application space, and then do the filtering there. Ugh.
  • Documentation for AS sucks. There's legacy "master" documentation for an older version of AS, but then you have to jump around reading release notes, and outdated Finder AS docs, and releases notes patched to that. There's no one central doc or docset that tells me how to program AS on OSX 10.2.2. At all.

So, AS is fine, except for data and algorithms and documentation. Ooops, what's left? {grin}

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • IIRC ORA France is working on an as yet unpublished title on AS that is supposed to fill in the kind of documentation gap you are referring to. It might be worth following what comes of it, the mothership does occasionally translate books from the "little ones" into English.

    --

    -- Robin Berjon [berjon.com]

  • I also found the file reference syntax very confusing and irritating. But then I discovered the POSIX keyword. With it, I can refer to files by their UNIX path - the way I am familiar with.
    E.g. (calling AppleScript from a shell script):
    echo "set ofile to POSIX file \"$audiofile\"
              say \"$message\" saving to ofile"
      | /usr/bin/osascript
  • This is why I wrote Mac::Glue. :-) It still isn't perfect ... you still have to deal with the shortcomings in the respective applications, of course, and other things inherent to Apple events, and AppleScript apart from its syntax. But at least you can avoid most of the syntax.

    Coming soong to Mac OS X ... maybe next couple of months.
  • But...but...but...it can do SOAP and look up stock prices. That's useful for programmers, isn't it. I've worked with Mac's on and off for over 12 years and have still been waiting to find a good reason to use AS. Also, I agree, finding a good source of documentation is painful, especially on the Apple site. Digging for documentation usually tells me I'm using the wrong tool.