realbasic-nug
[Top] [All Lists]

Re: Looping, threads and Applescript

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Looping, threads and Applescript
From: James Sentman <james at sentman dot com>
Date: Thu, 31 Jan 2008 21:31:04 -0500
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <AF0A2437-ABE6-4AA5-BA42-B15D73D33A8E at comcast dot net> <50D1C276-EA47-4206-97CE-7244FEB51A2B at sentman dot com> <C113441A-CAB0-4261-9406-EED0AD357A19 at oxalyn dot com>
On Jan 31, 2008, at 5:18 PM, Eric Williams wrote:

> This will make the system more "cancel-able" at the expense of
> performance - it seems like it's a lot of work for the system to
> execute an AppleScript, and calling one repeatedly is much more
> costly than writing the loop itself in AppleScript.

I do recall this being the case long ago and I haven't experimented  
lately. What do you suppose is the overhead for a script dragged into  
an app vs doing the same thing with declares? I have some apps that  
are attachable and very scriptable and host literally hundreds of  
applescript and I can call through them all very quickly by running  
the OSA routines through declares. But when you go to the RB  
applescript object by just dragging one in it gets slow. I wonder if  
they are creating a separate instance of the OSA connection for each  
one and connecting/disconnecting or even reloading the source for each  
one...

Yup, quick test seems to show that is what it is doing, so it's  
basically reloading the script each time you run it which isn't  
necessary if you dont need to have all your properties and variables  
reset to their default settings... Indeed, you could setup the loop  
and hit it from the outside and not have to do any resetting of data  
just keep it all inside the script, but you can't do that with the RB  
applescript feature. Perhaps some more features are necessary. To  
start a "maintain context" checkbox to make it not reload itself each  
time, and a "reloadScript" method or something to make it do so on  
command? We haven't gotten any new applescript or appleevent features  
in a very long time perhaps time to create some... and how about an  
Appleevent.DoubleProperty while we're at it too...


Thanks,
  James


James Sentman                       http://sentman.com          
http://MacHomeAutomation.com



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

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


<Prev in Thread] Current Thread [Next in Thread>