Effects

Auto Scene Switcher by Active Window

Posted by MMLTECH

This script adds an advanced rule-based system for automatically switching OBS scenes depending on which application or window is currently active on your computer. It is designed for streamers and workflow users who frequently move between

Auto Scene Switcher by Active Window image

OBS Auto Scene Switcher (Active Window Rules)

The OBS Auto Scene Switcher is a lightweight Lua script that automatically changes scenes in OBS Studio based on the currently active application on your Windows system. Instead of manually switching scenes every time you open a game, browser, or tool, the script monitors the foreground window and activates the scene you configure.

This version of the script was completely rewritten for stability and performance. Earlier approaches that relied on window enumeration and external tools could cause lag or freezes. The new implementation uses a lightweight polling system and Windows WinAPI calls to detect the active application quickly and reliably.

How the Script Works

The script periodically checks which window is currently active on your system using the Windows API. It reads two pieces of information from the foreground window:

  • Executable name – the program running the window (for example chrome.exe or wow.exe)
  • Window title – the visible title text of the active window

This information is then compared against the rules you configure inside the OBS Scripts panel. If a rule matches, OBS automatically switches to the scene assigned to that rule.

Scene switching is controlled by a configurable poll interval and cooldown timer to prevent rapid scene changes when windows change quickly.

Key Features
  • Automatic scene switching based on the active window
  • Rule-based matching using executable name, window title, or both
  • Optional substring filtering for more precise title matching
  • Support for up to 12 configurable rules
  • Adjustable polling interval for responsiveness control
  • Cooldown system to prevent rapid scene flickering
  • Case-sensitive or case-insensitive matching
  • Hotkey support to quickly enable or disable the script
  • Fully integrated into OBS Studio via Tools → Scripts
How to Configure Window Rules

Each rule determines when OBS should switch to a specific scene. Rules are evaluated from top to bottom, and the first matching rule wins.

To create a rule:

  1. Enable the rule checkbox.
  2. Enter the executable name of the application (for example chrome.exe).
  3. Optionally add a text filter for the window title.
  4. Select the scene that OBS should switch to.

If the executable field is left empty, the rule will match only by window title.

Example rules:

  • wow.exe → Switch to Game Scene
  • chrome.exe → Switch to Browser Scene
  • obs64.exe + Settings in title → Switch to BRB Scene
  • Empty executable + YouTube in title → Switch to Browser Scene
Hotkey Control

The script also includes a built-in hotkey that allows you to quickly toggle the automation on or off without opening the Scripts panel.

To assign the hotkey:

  1. Open OBS Settings
  2. Go to the Hotkeys tab
  3. Find Toggle Auto Scene Switcher
  4. Assign your preferred key combination

This is useful when you want to temporarily disable automation while adjusting scenes manually.

System Requirements

This script is designed specifically for OBS Studio on Windows. It relies on Windows WinAPI calls to detect the active window, so it is not compatible with macOS or Linux systems.

LuaJIT is already bundled with OBS Studio, so no additional dependencies or installations are required.

Installation Guide
  1. Download the .lua script file.
  2. Open OBS Studio.
  3. Navigate to Tools → Scripts.
  4. Click the + button and select the script file.
  5. Configure your rules and settings inside the script panel.

Once configured, OBS will automatically switch scenes whenever your active window matches a rule.

If you found this tool useful for your streaming workflow, you can discover more streaming resources, overlays, and tools at streamrsc.com.

You can also support development of scripts like this by donating on Ko-fi.

Use this item as a practical stream upgrade

This asset can be useful when you want a focused improvement without rebuilding your entire channel package. Download it, test the implementation, and adjust the final details around your brand.

For this specific resource, the key value is: This script adds an advanced rule-based system for automatically switching OBS scenes depending on which application or window is currently. Use the link below only after reading the details above so visitors understand what they are opening and why it belongs in their streaming workflow.

([redirect_url])[Open Auto Scene Switcher by Active Window]