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

Re: [MacPerl] Interfacing to AppleEvents



At 4:04 Uhr +0200 16.06.1997, Chris Nandor wrote:

>And as I have said repeatedly, I don't want to force anyone to give up
>AppleScript.  I personally dislike AS, but if you want to use it, I won't
>stop you.  What I want it to give people alternatives to AS and
>MacPerl::DoAppleScript.

Somehow I got a different impression, but I might have been overly
sensitive in this regard.

>At 12.44 97/6/15, Michael Schuerig wrote:
>>OTOH, I wouldn't even try to built object specifiers in perl. In AS it's as
>>easy as it can get: "set style of first line of first paragraph to bold";
>>or "set style of first word of every paragraph to bold" (this won't work
>>for most scriptable apps, but it's not AS's fault!).
>
>AE('app','set',{style=>{bold=>['pargraph','first',['line','first']]}});

Yes, that would be nice.

>>>4.)  AppleScript from MacPerl will alwyas be slower than AEs straight from
>>>MacPerl, because AppleScript has to be compiled first.  It takes an extra
>>>step.
>>
>>To the contrary. Perl has to compile the script *every time* it's going to
>>be executed (and it does this amazingly fast, of course). AS only compiles
>>scripts once. Have a look into a 'scpt' resource, it contains some sort of
>>AS bytecode. The compilation takes time and quite some in the current
>>implementation, so turnaround time in AS is longer.
>
>No.  I think you misunderstand what I said.  I did not say Perl is faster
>than AppleScript, I said AppleScript FROM Perl is slower than AppleEvents
>from Perl.  Yes, AppleScript (for now) is probably faster with AEs for the
>reason you mention.  But just as MacPerl has to be compiled each time, an
>AppleScript embedded in Perl has to be compiled each time.

Yes, I misunderstood you. How about loading the compiled script from a
resource?


Michael



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