Pause when certain window is not focused

Aureai

New Member
Hello! I'm an artist and it's important for me to be able to record what I paint in order to make timelapses. Recently I been realizing how much time it takes me to edit the instances where I am not doing anything on my art software and I tried to find a solution where OBS could detect the program it's not currently in use, pause, and resume once I am have the software in use again.

I followed some steps in a thread where someone wanted to do something very similar and while it works (basically using automatic scene switcher + pause script), every time my drawing software title changes its name, this whole methodology gets broken. I tried adding " ^* " in the name in the scene switcher but it doesn't work, it doesn't pause or record.

I been told I could use Advanced Scene Switcher, I tried it, but I haven't been able to make it work; most likely because I am using the wrong options.

This is the way the name changes in my art software, for example:

When the work it's saved:

Code:
PaintTool SAI Ver.2 (64bit) Preview.2020.01.25 - Things (Z:) / Art / 2021 / Commissions 2021 / Moon Moon / Drawing Files / Concept.psd

When the work it's not saved:

Code:
PaintTool SAI Ver.2 (64bit) Preview.2020.01.25 - Things (Z:) / Art / 2021 / Commissions 2021 / Moon Moon / Drawing Files / Concept.psd (*)

If anybody knows how to make what I am trying to achieve this, I'll be extremely thankful as it could save me countless of hours. Thank you!
 

Warmuptill

Active Member
As you have correctly identified in the other thread the issue lies in the provided window name which is interpreted as a regular expression.
The escaped version of window names so they can be used as a regular expression is:
(Saved)
PaintTool SAI Ver\.2 \(64bit\) Preview\.2020\.01\.25 \- Things \(Z\:\) \/ Art \/ 2021 \/ Commissions 2021 \/ Moon Moon \/ Drawing Files \/ Concept\.psd
(Unsaved)
PaintTool SAI Ver\.2 \(64bit\) Preview\.2020\.01\.25 \- Things \(Z\:\) \/ Art \/ 2021 \/ Commissions 2021 \/ Moon Moon \/ Drawing Files \/ Concept\.psd \(\*\)

>I been told I could use Advanced Scene Switcher, I tried it, but I haven't been able to make it work
In the advanced scene switcher you will not have to provide the escaped string.
The plugin will instead first try to match the the string directly and only if that didn't work try to interpret it as a regular expression.
SAI-title-match.PNG


If you want to be completely independent of window name and also trigger the pausing of the recording from the advanced scene switcher you can use the following settings for the plugin:
SAI-step1.PNG


SAI-pause-unpause.PNG


SAI-step2.PNG


Note that depending on your OBS settings you might not have the option to pause / unpause the recording.
If that is the case you will have to instead choose to stop / start the recording for the respective entries on the scene trigger tab.

Hope that helps.
 
Last edited:
Top