How do I wait for a VBScript to finish?

Bill Vlahos bvlahos at mac.com
Sat Aug 20 16:06:39 EDT 2011


Ken,

Sorry I took so long to reply. I had a medical problem that is fine now.

I'm using the sendText VBScript. Here is the script to send an item.


      put "Set WshShell = CreateObject(" & quote & "WScript.Shell" & quote & ")" & return & \
             "WshShell.SendKeys" && quote & field "TextToPut" & quote into Vscript
      sendText Vscript


Bill Vlahos
_________________
InfoWallet (http://www.infowallet.com) is about keeping your important life information with you, accessible, and secure.

On Aug 12, 2011, at 1:59 PM, Ken Ray wrote:

> 
> On Aug 12, 2011, at 2:26 PM, Bill Vlahos wrote:
> 
>> I call a VBScript and need to know when it finishes so that I can restore a window. I can put a long delay but that isn't very elegant and the time delay should be a few seconds but it may take longer on older systems.
>> 
>> I'm doing the same thing with an AppleScript on the Mac but it doesn't seem to have this problem but that could be that it just does it quick enough. 
>> 
>> Is there a way to wait with messages or something like that for running a VBScript or AppleScript?
> 
> Technically unless you are executing something in your VBScript that is asynchronous, calling VBScript from LiveCode should be blocking (i.e. you won't get control back to your script until the VBScript has finished). Is it possible that the VBScript is executing quickly and returning to LiveCode but the *effects* of what the VBScript asked the OS to do is taking a while to complete?
> 
> What VBScript are you executing, btw?
> 
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/	
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list