<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title>VoiceBot RSS: Delay until window active?</title>
<atom:link href="https://www.voicebot.net/Discussions/RSS/?TopicID=195b33ce-bca2-4f9e-98b3-df1c6323edb7" rel="self" type="application/rss+xml" />
<link>https://www.voicebot.net/Discussions/RSS/?TopicID=195b33ce-bca2-4f9e-98b3-df1c6323edb7</link>
<description>VoiceBot RSS: Delay until window active?</description>
<lastBuildDate>Sat, 02 May 2026 17:17:06 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.voicebot.net/Discussions/RSS/?TopicID=195b33ce-bca2-4f9e-98b3-df1c6323edb7</generator>
<item>
<title>RE: Delay until window active?</title>
<link>https://www.voicebot.net/Discussions/View/delay-until-window-active/?ID=195b33ce-bca2-4f9e-98b3-df1c6323edb7#2</link>
<pubDate>Mon, 31 Dec 2018 20:35:06 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/delay-until-window-active/?ID=195b33ce-bca2-4f9e-98b3-df1c6323edb7#2</guid>
<category>VoiceBot</category>
<description><![CDATA[If you use the script to launch the application, you can check to see if it's opened yet and wait longer if it hasn't. Here's some sample code that does that with Notepad:
Code
Copy
Select All
using System;
using System.Drawing;
public static class VoiceBotScript
{
public static void Run(...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
If you use the script to launch the application, you can check to see if it's opened yet and wait longer if it hasn't. Here's some sample code that does that with Notepad:<br/>
<br/>
<div class="col-md-12 BoxWrap"><div class="Box table-responsive"><a name="code" style="width:0; height:0;"></a><h2 class="TableTitle" style="border:0"><div class="TableTitleText">Code</div><div class="TitleButtons"><div class="TableTitleButton"><a href="#" onclick="return false;" data-clipboard-target="#code019de9b1a3907190b5250f2f9ac21596" class="ClipboardCopyControl"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019de9b1a3907190b5250f2f9ac21596Js'); return false;"><img src="https://www.voicebot.net/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;width:auto;max-width:16px;height:16px;" /><span class="Text">Select All</span></a></div></div></h2><div class="TableTitleContent table-responsive"><div class="AceEditorWrapper" style="border-top:solid 1px var(--color-default-border);padding:0"><pre id="code019de9b1a3907190b5250f2f9ac21596Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">using System;
using System.Drawing;

public static class VoiceBotScript
{
    public static void Run(IntPtr windowHandle)
    {
        // Launch the application
        uint appID = BFS.Application.Start(@"C:\Windows\Notepad.exe");
        
        // Wait up to 10 seconds for it to finish launching
        for (int i = 0; i &lt; 10; i++)
        {
            // If the window doesn't exist, wait 1 second and try again
            if (BFS.Application.GetMainWindowByAppID(appID) == null)
                BFS.General.ThreadWait(1000);
            // Otherwise, break out of the loop
            else
                break;
        }
    }
}</pre><textarea id="code019de9b1a3907190b5250f2f9ac21596" name="code019de9b1a3907190b5250f2f9ac21596" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
If you don't want to use scripting, you can just manually add a "Delay" action to the Macro and set it to something that you know will be longer than it takes for the application to open.<br/>
<br/>
Hope that helps!
</div>
]]></content:encoded>
</item>
<item>
<title>Delay until window active?</title>
<link>https://www.voicebot.net/Discussions/View/delay-until-window-active/?ID=195b33ce-bca2-4f9e-98b3-df1c6323edb7</link>
<pubDate>Mon, 24 Dec 2018 16:13:54 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.voicebot.net/Discussions/View/delay-until-window-active/?ID=195b33ce-bca2-4f9e-98b3-df1c6323edb7</guid>
<category>VoiceBot</category>
<description><![CDATA[I'm new to Voicebot.  I am wanting to  create some macros for work productivity.
I have no experience with C code or VBS.
Is it possible to create a delay until a window becomes active?
For example if I start a program and there is a delay as the program loads, can I create a delay in my macro...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
I'm new to Voicebot.  I am wanting to  create some macros for work productivity.<br/>
I have no experience with C code or VBS.<br/>
Is it possible to create a delay until a window becomes active?<br/>
For example if I start a program and there is a delay as the program loads, can I create a delay in my macro sequence that will wait to proceed to the next macro until the program has loaded and the window for that program is active?<br/>
Thanks!
</div>
]]></content:encoded>
</item>
</channel>
</rss>