<?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>DisplayFusion RSS: [Script Request] A function to switch focus to application that activates trigger</title>
<atom:link href="https://www.displayfusion.com/Discussions/RSS/?TopicID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2" rel="self" type="application/rss+xml" />
<link>https://www.displayfusion.com/Discussions/RSS/?TopicID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2</link>
<description>DisplayFusion RSS: [Script Request] A function to switch focus to application that activates trigger</description>
<lastBuildDate>Tue, 07 Apr 2026 01:19:41 GMT</lastBuildDate>
<language>en</language>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<generator>https://www.displayfusion.com/Discussions/RSS/?TopicID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2</generator>
<item>
<title>RE: [Script Request] A function to switch focus to application that activates trigger</title>
<link>https://www.displayfusion.com/Discussions/View/script-request-a-function-to-switch-focus-to-application-that-activates-trigger/?ID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2#4</link>
<pubDate>Tue, 31 Oct 2017 18:48:04 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-request-a-function-to-switch-focus-to-application-that-activates-trigger/?ID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2#4</guid>
<category>DisplayFusion</category>
<description><![CDATA[No worries, glad I could help!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
No worries, glad I could help!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: [Script Request] A function to switch focus to application that activates trigger</title>
<link>https://www.displayfusion.com/Discussions/View/script-request-a-function-to-switch-focus-to-application-that-activates-trigger/?ID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2#3</link>
<pubDate>Mon, 30 Oct 2017 19:09:51 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-request-a-function-to-switch-focus-to-application-that-activates-trigger/?ID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2#3</guid>
<category>DisplayFusion</category>
<description><![CDATA[That worked perfectly. I didn't think it would be that simple lol, thank you very much!]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
That worked perfectly. I didn't think it would be that simple lol, thank you very much!
</div>
]]></content:encoded>
</item>
<item>
<title>RE: [Script Request] A function to switch focus to application that activates trigger</title>
<link>https://www.displayfusion.com/Discussions/View/script-request-a-function-to-switch-focus-to-application-that-activates-trigger/?ID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2#2</link>
<pubDate>Mon, 30 Oct 2017 18:21:32 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-request-a-function-to-switch-focus-to-application-that-activates-trigger/?ID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2#2</guid>
<category>DisplayFusion</category>
<description><![CDATA[If you just use this in a Scripted Function, then call that from the Trigger (after the application launch actions), that should do the trick:
Code
Copy
Select All
BFS.Window.Focus(windowHandle);
Note that you will probably need to add a "Wait" action between the application launches and the...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
If you just use this in a Scripted Function, then call that from the Trigger (after the application launch actions), that should do the trick:<br/>
<br/>
<div id="" 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="#code019d65861c1471708773d999b3cff007" class="ClipboardCopyControl"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/clone.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;width:auto;max-width:16px;height:16px;" /><span class="Text">Copy</span></a></div><div class="TableTitleButton"><a href="#" onclick="bfs.util.codeEditorSelectAll('code019d65861c1471708773d999b3cff007Js'); return false;"><img src="https://www.displayfusion.com/MediaCommon/SVGs/FontAwesome/square-check.blue.svg" style="box-sizing:border-box;position:relative;overflow:hidden;vertical-align:middle !important;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="code019d65861c1471708773d999b3cff007Js" contenteditable="true" spellcheck="true" class="skiptranslate" style="width:100%; min-height:75px;">BFS.Window.Focus(windowHandle);</pre><textarea id="code019d65861c1471708773d999b3cff007" name="code019d65861c1471708773d999b3cff007" style="position:absolute; top:0; left:-999999px; width:1px; height:1px;"></textarea></div>
</div></div></div><br/>
<br/>
Note that you will probably need to add a "Wait" action between the application launches and the Scripted Function as well, otherwise the script will run as soon as DF has issued the start process command <img src="https://www.displayfusion.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=":)" HelpButtonDataAlign="BelowMiddle" /><br/>
<br/>
Hope that helps!
</div>
]]></content:encoded>
</item>
<item>
<title>[Script Request] A function to switch focus to application that activates trigger</title>
<link>https://www.displayfusion.com/Discussions/View/script-request-a-function-to-switch-focus-to-application-that-activates-trigger/?ID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2</link>
<pubDate>Sat, 28 Oct 2017 19:14:57 GMT</pubDate>
<dc:creator>Binary Fortress Software</dc:creator>
<guid isPermaLink="false">https://www.displayfusion.com/Discussions/View/script-request-a-function-to-switch-focus-to-application-that-activates-trigger/?ID=b4c00135-e9f9-4c62-b42e-6a95b582fdf2</guid>
<category>DisplayFusion</category>
<description><![CDATA[Hey there,
First of all, I absolutely love DisplayFusion, it has made my life a lot easier, so thank you for doing what you do!
Now, onto the reason for this post; I use a trigger to launch a couple of other applications, but the problem is, the window focus shifts as those other applications l...]]></description>
<content:encoded><![CDATA[<div class="CTDiscussions">
Hey there,<br/>
<br/>
 First of all, I absolutely love DisplayFusion, it has made my life a lot easier, so thank you for doing what you do! <br/>
<br/>
Now, onto the reason for this post; I use a trigger to launch a couple of other applications, but the problem is, the window focus shifts as those other applications launch and I need the focus back on the original window (for using hotkeys and such), so ideally, a function that switches focus to the window of the process that activated the trigger will solve my problem. If that is not currently possible, a function that basically does what alt+tab does but without the key simulation and the UI showing all the windows, would suffice. <br/>
<br/>
Forgive me if this problems seems trivial, I'm not much of a programmer so I couldn't bring myself to write a script to do that.<br/>
<br/>
I tried to be brief so I missed a couple of details and reasons as to why I'd like this, but feel free to ask me to clarify specifics.<br/>
<br/>
Thank you very much!
</div>
]]></content:encoded>
</item>
</channel>
</rss>