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

Re: [MacPerl] Interfacing to AppleEvents



>Please, no.
>1.)  A fundamental problem with AppleScript is its syntax.  Why continue to
>use it?

Most likely, you use it every day of your Mac life, you just don't see it.
It is an unavoidable and necessary part of the Mac at the moment.

>2.)  AppleScript is NOT the closest thing to a command line interpreter on
>a Mac.  That would be MPW.

Umm, that statement is pretty lame. I personally can't afford MPW, If you
would be willing to donate a copy, I would be happy to use it as my CLI.
But if commercial products are to qualify, then MachTEN would get my vote.
If MacOS is not a requirement, then NetBSD is the best :).

>3.)  AppleScript is NOT a common language all Macs speak.  Apple Events
>are.  AppleScript puts a user language (one I don't particularly like) on
>top of the Events.

AppleScript has been given with every system since 7.1, & fully supported
in 7.1.2 (system 7.1 plus scriptable finder).


>Right now, to disconnect from OT/PPP requires this:
>
>#!perl
>use Mac::AppleEvents;
>$evt =
>AEBuildAppleEvent('netw','RAdc',typeApplSignature,'MACS',0,0,'')||die $!;
>AESend($evt, kAEWaitReply) || die $!;
>
>Maybe something like this would be better:
>
>#!perl
>use Mac::AppleEvents;
>AEBuildSend('netw','RAdc','MACS');
>
>The other stuff stays the same for most all AE calls.  So maybe just a
>simplified syntax would be a start.  And I don't know the guts of how
>AppleScript gets its "words", but maybe MacPerl could grab the same English
>words used by AS:
>
>DoAE('','PPP disconnect') || die $!;
>#first variable is blank since command is sent to Finder
>
>And for connect:
>DoAE('','PPP connect',{address=>'555-1212',
>                       'user name'=>'chrisn',
>                       password=>'pass'}) || die $!;
>
>Obviously, a lot of AEs get more complicated than that, too.  But it's just
>an idea of how they might look.  I know that it looks beautiful to me.

Did you just say that something that's almost exactly AppleScript is
Beautiful??? Make up your mind!

Mike

Bikers don't *DO* taglines.



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