<?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: Only Run macro is an app has focus</title>
<atom:link href="https://www.clipboardfusion.com/Discussions/RSS/?TopicID=2d4d7e09-d1f9-491d-b7b1-5e771429609a" rel="self" type="application/rss+xml" />
<link>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=2d4d7e09-d1f9-491d-b7b1-5e771429609a</link>
<description>ClipboardFusion RSS: Only Run macro is an app has focus</description>
<lastBuildDate>Sat, 28 Nov 2026 16:27:28 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.clipboardfusion.com/Discussions/RSS/?TopicID=2d4d7e09-d1f9-491d-b7b1-5e771429609a</generator>
<item>
<title>RE: Only Run macro is an app has focus</title>
<link>https://www.clipboardfusion.com/Discussions/View/only-run-macro-is-an-app-has-focus/?ID=2d4d7e09-d1f9-491d-b7b1-5e771429609a#2</link>
<pubDate>Tue, 07 May 2019 13:57:31 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/only-run-macro-is-an-app-has-focus/?ID=2d4d7e09-d1f9-491d-b7b1-5e771429609a#2</guid>
<category>ClipboardFusion</category>
<description><![CDATA[After an all-nighter I managed to solve this
Code
Copy
Select All
using System;&#xA;using System.Collections.Generic;&#xA;&#xA;public static class ClipboardFusionHelper&#xA;{&#xA;&#xA;        &#xA;    public static string ProcessText(string text)&#xA;    {&#xA;        // Checking that Chrome ...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
After an all-nighter I managed to solve this<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="#code01a222fbaaff70bfa13573fdbc133f3c" 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('code01a222fbaaff70bfa13573fdbc133f3cJs'); 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="code01a222fbaaff70bfa13573fdbc133f3cJs" name="code01a222fbaaff70bfa13573fdbc133f3cJs" 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;&#xA;        &#xA;    public static string ProcessText(string text)&#xA;    {&#xA;        // Checking that Chrome os active&#xA;                &#xA;        IntPtr windowHandle = BFS.Window.GetFocusedWindow();&#xA;        string file = BFS.Application.GetMainFileByWindow(windowHandle);&#xA;        //BFS.Dialog.ShowMessageInfo(file);      &#xA;        if (file.Contains(&quot;chrome.exe&quot;) == true)&#xA;        {&#xA;        &#xA;        //If Chrome is active ... do your stuff here&#xA;            &#xA;        }&#xA;        &#xA;        return text;&#xA;    }&#xA;}</pre><textarea id="code01a222fbaaff70bfa13573fdbc133f3c" name="code01a222fbaaff70bfa13573fdbc133f3c" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
<item>
<title>Only Run macro is an app has focus</title>
<link>https://www.clipboardfusion.com/Discussions/View/only-run-macro-is-an-app-has-focus/?ID=2d4d7e09-d1f9-491d-b7b1-5e771429609a</link>
<pubDate>Mon, 06 May 2019 20:18:07 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.clipboardfusion.com/Discussions/View/only-run-macro-is-an-app-has-focus/?ID=2d4d7e09-d1f9-491d-b7b1-5e771429609a</guid>
<category>ClipboardFusion</category>
<description><![CDATA[Simple script in ClipboardFusion to replace text.
But I need the macro to only run if Chrome is the focused application.
Had a look at GetMainFileByWindow and other functions but can't get them implemented into the code.
Here's a sample of the current code, and help to add a statement if a win...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Simple script in ClipboardFusion to replace text.<br/>
But I need the macro to only run if Chrome is the focused application.<br/>
Had a look at GetMainFileByWindow and other functions but can't get them implemented into the code.<br/>
Here's a sample of the current code, and help to add a statement if a window (chrome) is the focused app will be appreciated. <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="#code01a222fbab0870e3a8e90c5dbc1ae16c" 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('code01a222fbab0870e3a8e90c5dbc1ae16cJs'); 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="code01a222fbab0870e3a8e90c5dbc1ae16cJs" name="code01a222fbab0870e3a8e90c5dbc1ae16cJs" spellcheck="true" class="skiptranslate" style="width:100%;min-height:75px">using System;&#xA;using System.Text.RegularExpressions;&#xA;&#xA;public static class ClipboardFusionHelper&#xA;{&#xA;    public static string ProcessText(string text)&#xA;    {&#xA;        //use the Regex class to replace any matched text with an empty string&#xA;    if (text.Contains(&quot;**&quot;))&#xA;    {&#xA;    text = text.Replace (&quot;**&quot;,&quot;&quot;);&#xA;    text = Regex.Replace (text, @&quot;(.*),.*- (.*),.*(\(.*)&quot;, &quot;$1 vs $2 $3&quot;);&#xA;    }    &#xA;    else&#xA;    {&#xA;        text = Regex.Replace (text, @&quot;\n&quot;, &quot;&quot;);&#xA;        text = Regex.Replace (text, @&quot;.*\[Date &quot;&quot;([1-2][0-9][0-9][0-9]).*\[White &quot;&quot;(.*)&quot;&quot;.*\[Black &quot;&quot;(.*)&quot;&quot;.*\[Result.*&quot;, &quot;**$2 - $3** ($1)&quot;);&#xA;    }&#xA;        &#xA;        BFS.Clipboard.PasteText(text);&#xA;        //get ClipboardFusion to replace the text on the clipboard with the text variable&#xA;        return text;&#xA;    }&#xA;}</pre><textarea id="code01a222fbab0870e3a8e90c5dbc1ae16c" name="code01a222fbab0870e3a8e90c5dbc1ae16c" style="position:absolute;top:0;left:-999999px;width:1px;height:1px"></textarea></div>
</div></div></div>
</div>
]]></content:encoded>
</item>
</channel>
</rss>