Advanced Scene Switcher

Advanced Scene Switcher 1.37.2

Hello, I'm testing out this plugin and would like to know what's the best way to set up a macro so that when a Window closes (e.g. Zoom.exe or Webex.exe), it'll make OBS stop recording? The conditions for Window only have "title matches, fullscreen, maximized, focused, focus window changed, and contains text". I was hoping for something to detect the existence of such a window. I tried "Window is focused", but that means I can't click on anything else while a meeting is in session.

I think you want the Process condition, not Window, and "If not" instead of "If". See if this works:
1709234223597.png

You probably want to uncheck the "focused" box. It does the same here as it does in the Window condition.

That said though, the simple existence of a window could be handy to add, using the list of windows instead of processes, since most of those processes don't even have windows.
 
That said though, the simple existence of a window could be handy to add, using the list of windows instead of processes, since most of those processes don't even have windows.
I can't check right now, but I think that it is already possible to check for the existence of given window title using the "Window" condition by simply unchecking all the additional optional checks. (focus, fullscreen, ...)
If not I will look into it.
 
Hi, my goal is to stop, wait a few secs, and then start the stream only when bitrate falls for a few seconds. Is there a way I can model this so that I can have it running at all times - even when not streaming? Currently when I run the attached, it starts streaming immediately.

It's not the biggest issue to start this macro after I go live, but ideally I'd love to just set it and forget it. Thanks!
 

Attachments

  • Screen Shot 03-01-24 at 11.38 AM.PNG
    Screen Shot 03-01-24 at 11.38 AM.PNG
    87.8 KB · Views: 548
Hi, my goal is to stop, wait a few secs, and then start the stream only when bitrate falls for a few seconds. Is there a way I can model this so that I can have it running at all times - even when not streaming? Currently when I run the attached, it starts streaming immediately.

It's not the biggest issue to start this macro after I go live, but ideally I'd love to just set it and forget it. Thanks!
I would suggest a setup similar to the following:
  • Add an additional macro which pauses your "Yt auto-restart" macro on OBS startup.
    1709379130555.png
  • Add a macro which un-pauses the "Yt auto-restart" macro as soon as you start streaming.
    1709379218628.png
Note that it is important, that the macro, which pauses the "Yt auto-restart" macro, is above the "Yt auto-restart" in the macro list.
The macros are executed from the top to the bottom of the list.
So, having the macro, which pauses "Yt auto-restart" on OBS startup, above "Yt auto-restart" ensures that it is executed before "Yt auto-restart" on OBS startup.

If you want to import the example macros you can use this code:
Code:
AAAKknic7VVNb9swDP0rhs5JkGTrsOa2BS1aYMWCpvvohiBgbNoRqkiGJGftgvz3UZKtOu3Qzadcegggk3zkE8mn7NgGUq0Mm/zcMQkbZBP2RZZQGUygsirRaCxom0BuUSc518YmxmqETeIdrMd8NJvkIAy6Lw1CoIgGJadrkAVFWF3Rt7nj5dk9pp/l3Cdo4gqtqjJ+ZSq9m6O1XBZEbsc0FtwQhRiwBnNdyY+VtUo2qck2c2SeWamSrcwnWLV4rXmxFvSzl/lUyYxbrqS5IUSM0E3+G7wnnozqNdc9sPua5Knkc1/dTPKmB0UCozrosX4CGhNHe3CAOHeEXoJ4xgO274V5fkidK8bMS8EtNW+mjP/20y7d1Een430vnkf7RZ3gjNKFJC9gT95E7NAhmxldKHuHD6a1EtSBYCT0IjaqbbKqKATOnpofW+DrpkoIKA1mMTenIwsLSatCTROq4CkRohWqNDjolcp4zt3q7JjlG1xSUkIAl9bHGXRV/JZtQbj5x8NwQH77ULrj3vHmAbJFbXwvRnsykxAsRYx7jHifa1LRpaQ2UI52qsdErleQ/vNWfhB0I5SwEs4Z1jmYJ+zWeoX2a4WyJuelzPC+VXjUvkEIcbyJA8YhOx4LN8z6CZjFB6BJnygZBE8afZX8q+SPLflSVAWXyyC9o6g+8nzqO766h39TN5m2oLmrdvB3f6VoAN+pgIFtDQiNxBwqYb+GOoy1ngcPue0EmaJ7EruVCZhudb7xzK7n/Dd2Qs3X6pe/VCfUNWS8Mp0gF+ien06QH0ptOgFyekBpG5fdmt2gurW72aj/AC1aImGjwfhkMOyv0MKof9ovxu+Hb9+N4ZTt/wDIxajV

Hope that helps! :)
 
I would suggest a setup similar to the following:
Note that it is important, that the macro, which pauses the "Yt auto-restart" macro, is above the "Yt auto-restart" in the macro list.
The macros are executed from the top to the bottom of the list.
So, having the macro, which pauses "Yt auto-restart" on OBS startup, above "Yt auto-restart" ensures that it is executed before "Yt auto-restart" on OBS startup.

If you want to import the example macros you can use this code:
Code:
AAAKknic7VVNb9swDP0rhs5JkGTrsOa2BS1aYMWCpvvohiBgbNoRqkiGJGftgvz3UZKtOu3Qzadcegggk3zkE8mn7NgGUq0Mm/zcMQkbZBP2RZZQGUygsirRaCxom0BuUSc518YmxmqETeIdrMd8NJvkIAy6Lw1CoIgGJadrkAVFWF3Rt7nj5dk9pp/l3Cdo4gqtqjJ+ZSq9m6O1XBZEbsc0FtwQhRiwBnNdyY+VtUo2qck2c2SeWamSrcwnWLV4rXmxFvSzl/lUyYxbrqS5IUSM0E3+G7wnnozqNdc9sPua5Knkc1/dTPKmB0UCozrosX4CGhNHe3CAOHeEXoJ4xgO274V5fkidK8bMS8EtNW+mjP/20y7d1Een430vnkf7RZ3gjNKFJC9gT95E7NAhmxldKHuHD6a1EtSBYCT0IjaqbbKqKATOnpofW+DrpkoIKA1mMTenIwsLSatCTROq4CkRohWqNDjolcp4zt3q7JjlG1xSUkIAl9bHGXRV/JZtQbj5x8NwQH77ULrj3vHmAbJFbXwvRnsykxAsRYx7jHifa1LRpaQ2UI52qsdErleQ/vNWfhB0I5SwEs4Z1jmYJ+zWeoX2a4WyJuelzPC+VXjUvkEIcbyJA8YhOx4LN8z6CZjFB6BJnygZBE8afZX8q+SPLflSVAWXyyC9o6g+8nzqO766h39TN5m2oLmrdvB3f6VoAN+pgIFtDQiNxBwqYb+GOoy1ngcPue0EmaJ7EruVCZhudb7xzK7n/Dd2Qs3X6pe/VCfUNWS8Mp0gF+ien06QH0ptOgFyekBpG5fdmt2gurW72aj/AC1aImGjwfhkMOyv0MKof9ovxu+Hb9+N4ZTt/wDIxajV

Hope that helps! :)
Thank you! Guessing that's why the macro did not kick in when conditions seemed like they were met last time - by the way, is there a log somewhere showing when/if macros are executed? EDIT: NEVERMIND - missed the verbose logging option!
 
Last edited:
Thank you! Guessing that's why the macro did not kick in when conditions seemed like they were met last time - by the way, is there a log somewhere showing when/if macros are executed? EDIT: NEVERMIND - missed the verbose logging option!
I will add additional logging options later today.
  • A macro action which lets you print custom log messages.
    309469536-05df1852-7da5-4b31-8e9e-5c26c36f4816.png
  • A log mode which will print actions performed by the plugin, but is less verbose than the verbose log mode.
    309469542-ec943ef3-91f0-43a7-bf80-e836a747f4c7.png

 
I will add additional logging options later today.
Awesome! Although when you have a moment, I believe I've imported and updated your suggestions - but the macro still keeps on starting my stream - on start up (since I have it set to start on OBS startup ofc), and shortly after stopping streaming, it'll keep starting up

I'm sure I'm missing something obvious - should I be adding an "AND above 1 kb/s" so stop streaming isn't treated as 0 kb/s?

Edit: added the AND condition for an Above condition - and it stopped restarting, but it doesn't seem I can trigger it to restart by forcing a bit rate in that range.
 

Attachments

  • Screen Shot 03-02-24 at 10.18 AM.PNG
    Screen Shot 03-02-24 at 10.18 AM.PNG
    52 KB · Views: 94
  • Screen Shot 03-02-24 at 10.19 AM.PNG
    Screen Shot 03-02-24 at 10.19 AM.PNG
    54.2 KB · Views: 155
  • Screen Shot 03-02-24 at 10.19 AM 001.PNG
    Screen Shot 03-02-24 at 10.19 AM 001.PNG
    71.5 KB · Views: 626
  • Screen Shot 03-02-24 at 10.20 AM.PNG
    Screen Shot 03-02-24 at 10.20 AM.PNG
    84.5 KB · Views: 94
Last edited:
NEVERMIND, it does work with that change - I widened the bitrate window that would trigger it and that seemed to do it - thank you very much - hope that I'm golden now!

not sure why 5k bitrate didnt trigger it when set to below 6000.00kb/s - but it did when I set it to 10000.00kb/s which will do the job

thanks again!
 

Attachments

  • Screen Shot 03-02-24 at 10.46 AM.PNG
    Screen Shot 03-02-24 at 10.46 AM.PNG
    96.1 KB · Views: 97
none of the images of the changelog work :(
Thanks for pointing that out!
For some reason the image links to the GitHub release page no longer work.
As there seems to be a 10 item attachment limit for a single post I have only added 10 of the images.
 
Last edited:
Hi. I updated the plugin version to 1.25.0 on my intel Mac, but I had an issue.

I'm using an audio trigger with settings output volume below 1% for a game audio, but it seems like it not working like used be.

Thanks
 
Hello All,

How do you run a nested macro but only as a nested macro? If I uncheck it in the Macro list then it is paused and won't run as a nested macro, the log says that it was paused.

If it is checked then it runs both nested and as a first level macro which negates that it should only be run if other other conditions are true.

cheers,

David
 
Hi. I updated the plugin version to 1.25.0 on my intel Mac, but I had an issue.

I'm using an audio trigger with settings output volume below 1% for a game audio, but it seems like it not working like used be.

Thanks
I am sorry about that!

I think I will need a bit more information to investigate what the issue might be.
Can you share a screenshot of the macro that is not working or export your settings to a file so I can try to reproduce the issue on my end?

Hello All,

How do you run a nested macro but only as a nested macro? If I uncheck it in the Macro list then it is paused and won't run as a nested macro, the log says that it was paused.

If it is checked then it runs both nested and as a first level macro which negates that it should only be run if other other conditions are true.

cheers,

David
If I understand correctly what you are trying to do I would recommend separate out the actions into a macro which does not have any conditions.
So something like this:
1709461247709.png

You would then use the "Macro" action to run the actions this helper macro in both the "First level macro" and the "Nested macro".
1709461292078.png

I hope this helped / the explanation was clear enough! :)
 
I am sorry about that!

I think I will need a bit more information to investigate what the issue might be.
Can you share a screenshot of the macro that is not working or export your settings to a file so I can try to reproduce the issue on my end?


If I understand correctly what you are trying to do I would recommend separate out the actions into a macro which does not have any conditions.
So something like this:
View attachment 102239
You would then use the "Macro" action to run the actions this helper macro in both the "First level macro" and the "Nested macro".
View attachment 102240
I hope this helped / the explanation was clear enough! :)
Hi,

OK, I can see that performing how you say it should and I wasn't aware of that.

However, I was wanting the nested macro to have it's own condition. I was hoping to split the condition logic over several macros to handle things like

If condition A and (condition B or condition C) then

Do you have any documentation on condition evaluation? For instance is it short circuit evaluation? How do I achieve bracket groups etc?

cheers,

David
 
Hi,

OK, I can see that performing how you say it should and I wasn't aware of that.

However, I was wanting the nested macro to have it's own condition. I was hoping to split the condition logic over several macros to handle things like

If condition A and (condition B or condition C) then

Do you have any documentation on condition evaluation? For instance is it short circuit evaluation? How do I achieve bracket groups etc?

cheers,

David
The condition logic works as if you had all of your open brackets up front, and then close one for each condition. It's easy to program that way, and I've done that myself a few times in other projects. But it does have some limitations, like you can't directly do ((A or B) and (C or D)).

But we also have the Macro condition here. So what you might do, is make a macro that has part of your logic in it, and no actions, and then use the Macro condition to see if that macro is true. Something like:
Macro 1: (C or D), no actions
Macro 2: ((A or B) and Macro 1), do something

No short-circuiting. Everything is always evaluated, even if it would make no difference. Again, easy to program, at the expense of some runtime efficiency and maybe some side-effects. A big side-effect would be running an external process to get its return code, and that external process does something else too. That's not *necessarily* bad in all cases, but definitely something to be aware of!
 
Last edited:
none of the images of the changelog work :(
looks like renaming a variable from the cog menu in the macro tab crashes obs all the time

Also a request, could you add a save button or autosave after a configurable amount of time? each time obs crashes i lose all the work done unless i close and reopen the plugin window, and crashes being random makes an autosave kind of useful :(
 
looks like renaming a variable from the cog menu in the macro tab crashes obs all the time
Can you please share the crash log?
I can't seem to reproduce it on my end for some reason.

looks like renaming a variable from the cog menu in the macro tab crashes obs all the time

Also a request, could you add a save button or autosave after a configurable amount of time? each time obs crashes i lose all the work done unless i close and reopen the plugin window, and crashes being random makes an autosave kind of useful :(
I will add that the plugin also saves its current settings when selecting a new macro.
 
Last edited:
I am sorry about that!

I think I will need a bit more information to investigate what the issue might be.
Can you share a screenshot of the macro that is not working or export your settings to a file so I can try to reproduce the issue on my end?
Thank you. I attached a screenshot. The thing is I want to trigger the macro when there is a moment that have no game sounds. Yet the trigger will activated even there is sounds all the time. I did a workaround by change the setting from below 1% to below -40.00dB, and it will works but even when it has very low volume. Let me know if there anything else that I need to show
 

Attachments

  • Screenshot.png
    Screenshot.png
    228.6 KB · Views: 173
Back
Top