[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Apple Event How-to?



Greetings:

I'm plotting stock market charts using MacPerl to generate Postscript and
using Mac GS to view it (both very fast), but the likes of:

&MacPerl'DoAppleScript(
'tell application "Mac GS Viewer PPC" to open alias "Hardisk:Desktop
Folder:Charter.out.ps"'
);    # Or could have Finder open it, after I set its file type to gsVR.

...takes about 10 seconds to set itself up at runtime, which gets old fast.
I assume it's AppleScriptLib loading into MacPerl?  I can do the same thing
in about 2 seconds by just double clicking the output file, which also gets
old fast.

It's only the compiling of a script that uses DoAppleScript itself that
takes time, not the Apple Script call itself.  Apple's Script Editor also
takes a long time for the first run, but then is instantaneous for
subsequent calls.  Is there a way to make MacPerl load the right stuff once
and for all?

I know I can do this faster with Apple Events and have looked at the
tutorials and "anarchist handbook" but I tossed my Inside Macintosh volumes
long ago (why do you think I'm using Perl?)

How do I do this?

- Nik Willmore

P.S. This is an escape from an initial routine using Mathematica, which I
had to hack over many days in order to end up with a simple 8.5 X 11 x,y
page which I could plot onto in inches; I aborted when I then figured out I
had to learn all about cell layouts to get the damn 8.5 X 11 graphic to
actually print onto a real 8.5 X 11 page without any
headers/borders/margins etc.