Economy-x-Talk - Sample Scripts
AS Studio Review
Article. Press tiangle to read.
Comes from AS ng.
Written by Simon Slavin
Okay, the 'subject' header is incorrect: I haven't actually used
the thing, I've just read the documentation from the site
http://developer.apple.com/techpubs/macosx/CoreTechnologies/AppleScriptStudio/
which pete posted to this group. You can click on the first link
and read it online, or download the PDF. Thanks for the link,
Pete. On reading the documentation, however, it turns out that I
have used all the components of ASS. So here's some comments.
------
The PDF document has about 200 pages of instruction in it. It
boils down to two walk-throughs for creating ASS applications
(one simple one and one complicated one) and instructions for
using all the development tools involved. It won't make any sense
unless you're already an accomplished AppleScript programmer.
ASS in its current form requires a full download of the OS X
development tools. These were formerly supplied to allow people
to develop programs for Mac OS X -- written in Objective-C and
using the OS X toolbox known as Cocoa. ASS simply allows you to
program in AppleScript instead of Objective-C. Everything else
stays the same. There's one bad result of this: the tools are
professional-level development-tools and therefore complicated.
ASS programming is not for the faint of heart.
So there are two main tools you use: Interface Builder and
Project Builder. Interface Builder has features like the dialog
creation part of ResEdit: you can define a window and put things
like buttons, fields, and popup-menus on it. IB is actually far
more complicated since you can pre-define a field as a date or a
number and have the system do syntax-checking for you, and you
can define how the various features move about as you change the
shape of the window.
Interface Builder allows you to connect each of these features
to a routine in your AppleScript: you can tell it "If the user
changes the value in this field, run my 'newFileLength' handler."
or "When the user closes the window, run 'windowClosed'.". The
routines which are run can find the values of the fields in the
window. Routines can also /change/ the values of the fields in
the window: you can have a change in one field trigger an
AppleScript handler which changes another field -- e.g. the
Fahrenheit-to-Centigrade converter.
Project Builder allows you do define an application: you can say
"This AppleScript interacts with these two dialogs.", define
some things about the resulting application, and build it. This
gives you one program icon which contains all the required
information (just like an Objective-C program contains all the
required code and dialog information). This is the last stage
of developing your ASS application: turn it into a clickable
icon. Project Builder has also swallowed most of the features
of Script Editor: you can edit AppleScripts in it and it will
help you by doing syntax-checking and indentation for you.
Unfortunately, Project Builder is a general development
environment, more usually tuned to Objective-C development,
and having the complicated interface required to cope with many
different programming languages and features of all compiled
Carbon and Cocoa applications. The advantage to all this is
that your ASS application has access to /all/ the Cocoa toolbox.
------
So how do I feel about all this ? Well I've been using Interface
Builder and Project Builder to do Objective-C development already
so I didn't have to learn them anew. But I think that they'll
scare off a lot of people with their complexity, not to mention
the fact that they're a 186 Megabyte download. If you want to
write a Mac OS X application without learning C, this is a way to
do it. It could be used to prototype an application before
handing the development over to a professional programmer, or it
could be a way to write a quick-and-dirty application which works
convincingly like a 'proper' OS X application icon, albeit a bit
more slowly.
Interface Builder is fun: you can spend hours dinking around with
your buttons, pop-up menus, lists, and fields, getting them to
look just the way you want them to. It's just like ResEdit was
in the old days.
I'm looking-forward to a possible future, though: a new version
of Script Editor which does everything that Interface Builder
doesn't do, meaning that you don't have to get involved with the
very complicated Project Builder. Script Editor and Interface
Builder could be included in the normal distribution of OS X,
meaning that ASS developers wouldn't have to subscribe to the
development program and install 180-odd Megabytes of development
tools.
I don't really know if ASS will take off. If all you want is a
progress bar, it's far too much effort. On the other hand, the
lack of a decent user-interface has hampered quite a bit of my
AS development, meaning that I generally only write AppleScripts
for myself rather than to give to other people in my organisation.
Maybe ASS will change this.
Simon.
Keep this extensive resource of tutorials and samples on-line! Support RunRev.info!
| Yes, this script is useful. I make a donation and choose freely how much I want to donate on-line (PayPal). Click here if you want to make a donation in dollars. | This script has not (completely) solved my problem and I want Economy-x-Talk to take care of it. Let me contact you. |
Copyright©2002-2008 by Mark Schonewille, Nijmegen, the Netherlands. This web site is in no way affiliated with Runtime Revolution Ltd., but we do recommend the Revolution development platform.