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

Re: [MacPerl] Apple Event examples



Chris Hector writes on Fri, 11 Jul 1997 12:16:49 -0500:

>Does anyone have some sample perl scripts that use
>AppleEvents?
>
>I'm looking into a couple of experiments:
>
>Controlling Netscape via Perl
>Controlling Clip2Gif via Perl
>
>I can do this via applescript, but I's like to speed things up.
>
>Also, just a simple OpenFile example.

This should open a file:

----------------

    #!perl

    use Mac::Files;
    use Mac::AppleEvents;

    $folder_alias = NewAliasMinimal("HD:dirA:dirB");
    $file_alias = NewAliasMinimal("HD:dirA:dirB:myFile");

    $evt = AEBuildAppleEvent(
        "FNDR", "sope", typeApplSignature, "MACS", 0, 0,
        "'----':alis(\@\@), fsel:[alis(\@\@)]",
        $folder_alias, $file_alias
    ) or die $^E;
    $rep = AESend($evt, kAEWaitReply) or die $^E;

    AEDisposeDesc $evt;
    AEDisposeDesc $rep;

----------------


AEPrint($evt) and AEPrint($rep) are often useful for test purposes.

A script by David C. Schooley extracts the 'aete' resources from scriptable
applications. It is an invaluable aid for the construction of AEBuild
events and is available from:

        ftp://ftp.ee.gatech.edu/pub/mac/Widgets/aete.converter_1.1.sea.hqx

You will certainly need this to see what Netscape and Clip2Gif have in
their 'aete' resources.

A small control panel which allows some or all AE Events to be tracked at
various selectable levels of information can also be helpful in developing
AEBuild events and is is available from:

        ftp://ftp.amug.org/pub/amug/bbs-in-a-box/files/system7/a/
                           aetracker2.0.sit.hqx

Hope this is some help,

Alan Fry

++++++++++

>Didn't see any in the FAQ or Macperl archive.
>
>TIA
>
>Chris
>
>
>Chris Hector
>---
>
>        Remember, Today is the Tomorrow you worried about Yesterday...
>
>
>mailto:chris@sunpack.com        - Phone (612)785-2505 x616
>                                  Fax   (612)785-2210
>http://www.sunpack.com/RTF/     - rtftohtml 3.6 is HERE!
>http://www.sunpack.com/         - Custom Packaging for
>                                  Audio/Video/Software
>
>
>
>
>
>***** Want to unsubscribe from this list?
>***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch