On 12-May-07, at 9:42 AM, Arnaud Nicolet wrote:

> Hi,
>
> I've the habit to use AppleEvents rather than AppleScript because I
> think AppleEvents are faster.
>
> However, sometimes, I can only do things with AppleScript but not
> with AppleEvents (the result is a too complex AppleEvent that doesn't
> even work).
> Are AppleEvents actually faster? If not, I will only use AppleScript
> scripts.
>
> I imagine that, when RB executes a script, the AppleScript engine
> needs to be loaded (maybe once per app?) and then the script is
> interpreted, so that slows down the execution of a script vs
> AppleEvents.
>
> Is it the right track?

Also note that AppleScript is going to do things slightly differently  
than raw apple events

A script like

        tell application "MS Word"
        end tell

launches MS Word first (by name) and then executes whatever script  
you tell it to execute.

Raw AppleEvents don't usually do this unless you add in the  
appropriate code to do this.

However, unless you write your AppleScript specially you can run into  
issues if people rename applications (they do this)
Raw apple events do not have this same issue

But you can write a script that is also not sensitive to application  
name, it just takes some work

As Christian mentioned though, the scripts are not precompiled and so  
there can be some "start up" cost associated with executing one.

If you dont use MBS there is no way around this that I am aware of
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to