Auto Scene Switcher by Active Window (Windows Only)

OBS Lua Auto Scene Switcher by Active Window (Windows Only) v2025.11.24-2

Auto Scene Switcher by Active Window (WIN Only)​

preview.png
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 programs and want OBS to react instantly and reliably.

What the Script Does​

The script monitors the foreground window using Windows WinAPI (via LuaJIT) and compares the window’s executable name and title against a list of user-configurable rules. When a match is found, OBS switches to the specified scene.

It supports up to eight independent rules, allowing flexible automation for gaming, productivity, communication apps, or any other workflow where different scenes are needed depending on the program in focus.

Key Features​

  • Automatic scene switching based on active window
  • Match rules by executable name, window title, or both
  • Optional additional substring filter for precise title matching
  • Up to 8 configurable rules
  • Adjustable polling interval (how often the active window is checked)
  • Adjustable cooldown to prevent rapid scene changes
  • Refresh button for updating the list of currently open windows
  • Fully integrated script settings panel inside OBS

Requirements​

  • OBS Studio for Windows
  • LuaJIT (included in OBS)
  • WinAPI access (Windows-only not compatible with macOS or Linux)

Installation​

  1. Download the .lua file.
  2. Open OBS Studio.
  3. Go to Tools → Scripts.
  4. Click the + icon and add the script.
  5. Configure your rules and settings in the script properties panel.

Some Notes​

  • Only top-level visible windows are listed when refreshing.
  • Scene names must match exactly as they appear inside OBS.
  • Rules are checked in order, the first matching rule is executed.
  • For more complex matching, combine "Any window" with a custom title filter.
If you want to support further development and help me build more plugins and scripts, you can do so here:

Ko-fi: https://ko-fi.com/mmltech
PayPal: https://paypal.me/mmlTools
Author
MMLTech
Downloads
12
Views
25
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from MMLTech

  • Stream Health HUD
    OBS Lua Stream Health HUD
    Real-Time Performance Overlay, show stream time, CPU, bitrate and lost frames in a text GDI
  • Smart Chapters
    OBS Lua Smart Chapters
    Smart Chapters - Create Chapters for Youtube, VOD Indexing and Long tutorials on the fly
  • Fly Scoreboard
    Free Fly Scoreboard
    A lightweight, hotkey-friendly scoreboard overlay for OBS Studio designed for live sports, esports,
  • Audio Waves
    Audio Waves
    Generates a visual audio-wave source from any input and lets you position it freely.
  • Smart Lower Thirds
    Semi-free Smart Lower Thirds
    Broadcast-grade lower thirds with full customization and zero setup headaches.
Top