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: Michael <mdeh at comcast dot net>
Date: Thu, 31 Jan 2008 20:45:10 -0800
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>
>>>
>>
>> An applescript should wait for the app being scripted to finish the
>> command before moving onto the next command. Unless you have it in a
>> loop of "ignoring application responses" in which case it will just
>> queue up the events as fast as possible and give the app a heart
>> attack.


I am sure you are correct, but the problem, I think was the loop is in  
RB, which is unaware, I believe, that it is waiting for anything, and  
so simply fires off the next command. So, my task is to figure out a  
way to let RB know when it is ok to send the next AS command. Why not  
do it all in AS? Simply because I know RB and know that the initial  
scan and parse for those duplicates is  lightning fast.

>>
>
> Perhaps you could break the loop down into smaller chunks that are
> not actually atomic - for example, instead of having AppleScript loop
> through 1,000 items, or calling the script 1,000 times, have the
> script process 100 items and then return back to your application.
>


I think it would be nice to figure out where the problem is...not sure  
how to do this though. For, if, as alluded to above, it is simply that  
RB sends the "next" move command before Mail is ready, then I need to  
figure out a way of getting feedback from Mail when it has responded  
to the script. I think each AS command does have a result, so I could  
read this. The trick then would be to get RB to loop in "hold" till  
that result was received.

Thanks for your input.

Michael.

_______________________________________________
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>