<?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>ClipboardFusion RSS: Help with Macro Error Correction &amp; Enhancement</title>
<atom:link href="https://www.clipboardfusion.com/Discussions/RSS/?TopicID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0" rel="self" type="application/rss+xml" />
<link>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0</link>
<description>ClipboardFusion RSS: Help with Macro Error Correction &amp; Enhancement</description>
<lastBuildDate>Wed, 16 Sep 2026 17:32:20 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0</generator>
<item>
<title>RE: Help with Macro Error Correction &amp; Enhancement</title>
<link>https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#6</link>
<pubDate>Wed, 31 Jan 2018 19:51:06 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#6</guid>
<category>ClipboardFusion</category>
<description><![CDATA[No worries, glad to hear it!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
No worries, glad to hear it!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Macro Error Correction &amp; Enhancement</title>
<link>https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#5</link>
<pubDate>Wed, 31 Jan 2018 19:21:45 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#5</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Thanks Keith worked like a charm
Thank you so much for helping out!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Thanks Keith worked like a charm <img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/face-laugh-squint.light.svg" alt=":D" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":D" /><br/>
<br/>
Thank you so much for helping out!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Macro Error Correction &amp; Enhancement</title>
<link>https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#4</link>
<pubDate>Wed, 31 Jan 2018 19:11:04 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#4</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Ok, try this out for the second thing
Code
Copy
Select All
using System;&#xA;using System.Collections.Generic;&#xA;using System.Windows.Forms;&#xA;using System.IO;&#xA;&#xA;public static class ClipboardFusionHelper&#xA;{&#xA;    public static string ProcessText(string text)&#xA;    {&#xA;    ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Ok, try this out for the second thing <img src="https://www.clipboardfusion.com/MediaCommon/SVGs/FontAwesome/face-smile.light.svg" alt=":)" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:16px;height:16px;" HelpButtonData=":)" /><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="#code01a0ab46d1d37648ac9716f604d97db0" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/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('code01a0ab46d1d37648ac9716f604d97db0Js'); return false;"><img src="https://www.clipboardfusion.com/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="code01a0ab46d1d37648ac9716f604d97db0Js" name="code01a0ab46d1d37648ac9716f604d97db0Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Collections.Generic;&#xA;using System.Windows.Forms;&#xA;using System.IO;&#xA;&#xA;public static class ClipboardFusionHelper&#xA;{&#xA;    public static string ProcessText(string text)&#xA;    {&#xA;        // Copy the selected text&#xA;        text = BFS.Clipboard.CopyText();&#xA;        &#xA;        // If the copied selection is a file list from Explorer, run the &quot;Get Filenames from Clipboard&quot; macro&#xA;        if (Clipboard.ContainsFileDropList())&#xA;        {&#xA;            BFS.ClipboardFusion.RunMacro(&quot;Get Filenames from Clipboard&quot;, text, out text);&#xA;            BFS.Clipboard.SetText(text);&#xA;        }&#xA;            &#xA;        // Launch Notepad&#xA;        uint appID = BFS.Application.Start(&quot;notepad.exe&quot;);&#xA;        &#xA;        // Wait up to 10 seconds for it to open and receive focus&#xA;        for (int i = 0; i &lt; 10; i&#x2B;&#x2B;)&#xA;        {&#xA;            // If the newly launched Notepad window has focus, paste the text and break out of the loop&#xA;            if (BFS.Window.GetFocusedWindow() == BFS.Application.GetMainWindowByAppID(appID))&#xA;                {&#xA;                    BFS.Clipboard.Paste();&#xA;                    break;&#xA;                }&#xA;            &#xA;            // If we got here, the Notepad window doesn&#x27;t yet have focus, wait 1 second before restarting the loop&#xA;            BFS.General.ThreadWait(1000);&#xA;        }&#xA;        return text;&#xA;    }&#xA;}</pre><textarea id="code01a0ab46d1d37648ac9716f604d97db0" name="code01a0ab46d1d37648ac9716f604d97db0" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Macro Error Correction &amp; Enhancement</title>
<link>https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#3</link>
<pubDate>Wed, 31 Jan 2018 16:47:17 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#3</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Hi Keith,
Thank you so much for helping out. Worked like a charm for the 1st issue.
Thanks,
Usama Waheed]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hi Keith,<br/>
<br/>
Thank you so much for helping out. Worked like a charm for the 1st issue.<br/>
<br/>
Thanks,<br/>
Usama Waheed
</div>
]]></content:encoded>
</item>
<item>
<title>RE: Help with Macro Error Correction &amp; Enhancement</title>
<link>https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#2</link>
<pubDate>Wed, 31 Jan 2018 16:09:36 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0#2</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Let's solve the first problem first (verifying that the Notepad window has focus). Can you give this code a try?
Code
Copy
Select All
using System;&#xA;using System.Collections.Generic;&#xA;&#xA;public static class ClipboardFusionHelper&#xA;{&#xA;    public static string ProcessText(string te...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Let's solve the first problem first (verifying that the Notepad window has focus). Can you give this code a try?<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="#code01a0ab46d1f4767a81b6013250cbaea8" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/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('code01a0ab46d1f4767a81b6013250cbaea8Js'); return false;"><img src="https://www.clipboardfusion.com/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="code01a0ab46d1f4767a81b6013250cbaea8Js" name="code01a0ab46d1f4767a81b6013250cbaea8Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Collections.Generic;&#xA;&#xA;public static class ClipboardFusionHelper&#xA;{&#xA;    public static string ProcessText(string text)&#xA;    {&#xA;        // Copy the selected text&#xA;        BFS.Clipboard.CopyText();&#xA;        &#xA;        // Launch Notepad&#xA;        uint appID = BFS.Application.Start(&quot;notepad.exe&quot;);&#xA;        &#xA;        // Wait up to 10 seconds for it to open and receive focus&#xA;        for (int i = 0; i &lt; 10; i&#x2B;&#x2B;)&#xA;        {&#xA;            // If the newly launched Notepad window has focus, paste the text and break out of the loop&#xA;            if (BFS.Window.GetFocusedWindow() == BFS.Application.GetMainWindowByAppID(appID))&#xA;                {&#xA;                    BFS.Clipboard.Paste();&#xA;                    break;&#xA;                }&#xA;            &#xA;            // If we got here, the Notepad window doesn&#x27;t yet have focus, wait 1 second before restarting the loop&#xA;            BFS.General.ThreadWait(1000);&#xA;        }&#xA;        return text;&#xA;    }&#xA;}</pre><textarea id="code01a0ab46d1f4767a81b6013250cbaea8" name="code01a0ab46d1f4767a81b6013250cbaea8" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>Help with Macro Error Correction &amp; Enhancement</title>
<link>https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0</link>
<pubDate>Tue, 30 Jan 2018 21:43:33 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/help-with-macro-error-correction-enhancement/?ID=95a1ee23-7d0d-4c2a-b693-de2de06d27b0</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Hi Guys,
Was creating a small macro, that does the following:
Copy Selected TextOpens Notepad.exePaste the selected text
The issue is if I do the following code, sometime CF pastes before even notepad window gets focus:
Code
Copy
Select All
using System;&#xA;using System.Collections.Generi...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hi Guys,<br/>
<br/>
Was creating a small macro, that does the following:<br/>
<br/>
<ul class="ListBullet"><li>Copy Selected Text</li><li>Opens Notepad.exe</li><li>Paste the selected text</li></ul>
<br/>
The issue is if I do the following code, sometime CF pastes before even notepad window gets focus:<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="#code01a0ab46d20c763d995c890c658e3293" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/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('code01a0ab46d20c763d995c890c658e3293Js'); return false;"><img src="https://www.clipboardfusion.com/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="code01a0ab46d20c763d995c890c658e3293Js" name="code01a0ab46d20c763d995c890c658e3293Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Collections.Generic;&#xA;&#xA;public static class ClipboardFusionHelper&#xA;{&#xA;    public static string ProcessText(string text)&#xA;    {&#xA;        &#xA;        BFS.Clipboard.CopyText();&#xA;        BFS.Application.Start(&quot;notepad.exe&quot;);&#xA;        BFS.Clipboard.Paste();&#xA;        return text;&#xA;    }&#xA;}</pre><textarea id="code01a0ab46d20c763d995c890c658e3293" name="code01a0ab46d20c763d995c890c658e3293" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div><br/>
<br/>
I resolved that issue by using ThreadWait in between application start and paste, however, I believe that is not a proper method so I wanted to use the WindowFocus and that is where I get the error. Below is the code and the error:<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="#code01a0ab46d20f71f2b979c3cfada81da6" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/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('code01a0ab46d20f71f2b979c3cfada81da6Js'); return false;"><img src="https://www.clipboardfusion.com/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="code01a0ab46d20f71f2b979c3cfada81da6Js" name="code01a0ab46d20f71f2b979c3cfada81da6Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Collections.Generic;&#xA;&#xA;public static class ClipboardFusionHelper&#xA;{&#xA;    public static string ProcessText(string text)&#xA;    {&#xA;        &#xA;        BFS.Clipboard.CopyText();&#xA;        BFS.Application.Start(&quot;notepad.exe&quot;);&#xA;        IntPtr mainWindow = BFS.Application.GetAppIDByWindow(&quot;Untitled - Notepad&quot;); &#xA;        BFS.Window.Focus(mainWindow);&#xA;        //BFS.General.ThreadWait(500);&#xA;        BFS.Clipboard.Paste();&#xA;        return text;&#xA;    }&#xA;}</pre><textarea id="code01a0ab46d20f71f2b979c3cfada81da6" name="code01a0ab46d20f71f2b979c3cfada81da6" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div><br/>
<b><span style="text-decoration:underline;">ERROR:</span></b><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="#code01a0ab46d21173e78aad232d6e1cabc2" class="ClipboardCopyControl"><img src="https://www.clipboardfusion.com/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('code01a0ab46d21173e78aad232d6e1cabc2Js'); return false;"><img src="https://www.clipboardfusion.com/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="code01a0ab46d21173e78aad232d6e1cabc2Js" name="code01a0ab46d21173e78aad232d6e1cabc2Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">The best overloaded method match for &#x27;BFS.Application.GetAppIDByWindow(System.IntPtr)&#x27; has some invalid arguments&#xA; Argument 1: cannot convert from &#x27;string&#x27; to &#x27;System.IntPtr&#x27;</pre><textarea id="code01a0ab46d21173e78aad232d6e1cabc2" name="code01a0ab46d21173e78aad232d6e1cabc2" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div><br/>
<br/>
Can someone kindly help with the above code. Also is there is another Macro that Thomas created "Get Filenames from Clipboard". Is it possible to achieve the following:<br/>
<ul class="ListBullet"><li>Check Selected Data, If text proceed to next step. If files then get result from "Get Filenames from Clipbpard Macro"</li><li>Open Notepad</li><li>Make sure the focus command makes it active (Is it possible to handle a case where multiple notepad files are open then focus on the newly created process?)</li><li>Paste either the Filenames or Text</li></ul>
<br/>
Thanks is advance guys.
</div>
]]></content:encoded>
</item>
</channel>
</rss>