RE: scripting on macs in general
RE: scripting on macs in general
- Subject: RE: scripting on macs in general
- From: email@hidden
- Date: Mon, 15 Jul 2002 14:39:49 EDT
Ian,
AppleScript is a true high-level language, whose strength
is the ability to use the capabilities of existing software
packages (i.e. - applications, not via run-time loading of
software libraries like C/C++/Pascal/etc), rather than a
direct competitor to an application development environment
like C/C++, etc. An example:
A customer had one of their secretaries downloading ASCII
tables of market saturation for various ads each morning
(via a direct dial-up access to a mainframe); she would
manually clean up the text, replacing spaces with tabs,
coax the data into a spreadsheet (excel), arrange
formula's, then use the results to generate graphs. These
were printed for local usage and faxed back to corporate
HQ. Total time per day: 2 - 4 hours, depending on her
productivity.
I could have written software to perform this in C/C++ (or
Basic/Pascal/etc), but it would have involved adding and
learning library functions for modem control, bit
negotiation, ZTerm data transfers, spooling the file
locally, string manipulation for conversion to the desired
data format, various math libraries (mostly statistical),
and a rendering development engine to generate the
graphics.
Instead, as an applescript (and to wit, I did use QuicKeys
to help), the script opens the modem software, dials, logs
in, downloads the file, signs out; then opens a fast text
editor and GREP's the text, resaves; opens excel and
manipulates; moves to CricketGraph and generates the
graphs (prettier than excel!); prints the local copies,
emails the graphics to the appropriate people at HQ and
finally generates both PDF and html files (which get stored
in the appropriate places on a remote server). Total run
time: about 15 minutes on an old machine, before anyone
gets to the office (thank Apple for Energy Saver being able
to boot the machine!).
Now, from the development end, let's look at time
differences:
Total time to do the project in C/C++ -- probably around
45 hours, my best calculation. I might be able to wittle it
down to 24 hours if I was already adept at modem libraries
and graph graphics generation with a specific rendering
engine.
Total time to do the same project in AppleScript (with
debugging, changes in certain options after it was
implimented, and on-site installation/configuration,
including travel time): 12 hours. Oh, and that was 5 years
ago...
As a programmer adept at a fairly large number of
programming languages, I can't say that applescript is the
ideal programming solution. It isn't, if you want to build
true stand-alone apps (such as games, etc.). But it is an
ideal method for scripting multiple application interaction
with data sharing; more robust than most methods and
definitely more capable in terms of the number of apps
supporting the process method. That, and it has managed
to make people believe that non-programmers can use it*.
NOTE(*) - if you program AppleScript, and you understand
if/then and repeat commands, you are a programmer,
whether you like it or not.
Hope that answers your question...
Best Wishes,
=-=Marc Glasgow
Ian Wrote:
>
I am new to applescript but have done software for a few
>
decades...........
>
>
I see AS panned a bit in the lists and wonder if it is not
>
possible that a more general language might not work as
>
well. Are the interfaces to Java, etc. adequate to do all
>
the things that one can do in AS? What are the relative
>
merits and limitations?
>
>
It seems at a glance hard to deal with dialog boxes in AS.
>
Is that true?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.