Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

Warmuptill

Active Member
Is there something I can use to tell the macro to trigger when anything about a file is modified regardless of text matching?
That is exactly what the above example should do.
The ".*" in combination with "use regular expressions" stands for "regardless of text matching" and the "if modification date changed" and "if content changed" should cover the "file is modified" part.

Maybe I am misunderstanding or missing something - can you give a concrete example where the above will not work?
 

Lycanthrope -R-

New Member
That is exactly what the above example should do.
The ".*" in combination with "use regular expressions" stands for "regardless of text matching" and the "if modification date changed" and "if content changed" should cover the "file is modified" part.

Maybe I am misunderstanding or missing something - can you give a concrete example where the above will not work?
You didn't misunderstand. But unfortunately what you gave me didn't do anything.

Screenshot (20).png

This is what you showed me, correct? But with this, no matter how many times I edit the html file, nothing changes. No green blinking, or anything saying that the macro was recently triggered.

If I flip it to "If not", the macro will trigger once and only once. And the top portion will blink green continuously, showing that the top is "true." But after that, if I edit the file, nothing happens.

I could unclick "Perform actions only on condition change" and the macro will keep triggering endlessly, but that's not what I want.

What should I try next?
 

Warmuptill

Active Member
You didn't misunderstand. But unfortunately what you gave me didn't do anything.

View attachment 86471
This is what you showed me, correct? But with this, no matter how many times I edit the html file, nothing changes. No green blinking, or anything saying that the macro was recently triggered.

If I flip it to "If not", the macro will trigger once and only once. And the top portion will blink green continuously, showing that the top is "true." But after that, if I edit the file, nothing happens.

I could unclick "Perform actions only on condition change" and the macro will keep triggering endlessly, but that's not what I want.

What should I try next?
Hm ... very interesting.
It seems like all this time I didn't notice that the regular expressions are currently only allowing to match one line at a time.
So you would have to add ".*" for each line in your file.
This is of course not feasible and something I will change.
Thank you very much for bringing this to my attention!

To unblock you I started a build where this behaviour is changed for the file condition.
Should finish in a few minutes and be available here:
You will have to be logged into GitHub to be able to download it.

I will clean this up in the other areas where regular expressions can be used to match multiple lines also.
 

AaronD

Active Member
Hm ... very interesting.
It seems like all this time I didn't notice that the regular expressions are currently only allowing to match one line at a time.
So you would have to add ".*" for each line in your file.
This is of course not feasible and something I will change.
Thank you very much for bringing this to my attention!

To unblock you I started a build where this behaviour is changed for the file condition.
Should finish in a few minutes and be available here:
You will have to be logged into GitHub to be able to download it.

I will clean this up in the other areas where regular expressions can be used to match multiple lines also.
I believe that line-per-line is the default behavior for regular expressions, so changing it away from that would probably break something else. But yes, there needs to be a way to do this as well.

Notepad++ has this option:
1662851321427.png
 

Warmuptill

Active Member

Warmuptill

Active Member
I believe that line-per-line is the default behavior for regular expressions, so changing it away from that would probably break something else. But yes, there needs to be a way to do this as well.

Notepad++ has this option:
View attachment 86480
Thank you for the hint!
I can't think of many situations where enabling "." matching newline would break an existing setup and I think having this setting by default is more in line as to what is expected / more useful in the situations where regular expressions are used in the plugin.

But I plan on having the option to use "^" and "$" to match the beginning and end of lines among other things, if it is required for some cases:

File.PNG
 

AaronD

Active Member
Thank you for the hint!
I can't think of many situations where enabling "." matching newline would break an existing setup and I think having this setting by default is more in line as to what is expected / more useful in the situations where regular expressions are used in the plugin.

But I plan on having the option to use "^" and "$" to match the beginning and end of lines among other things, if it is required for some cases:

View attachment 86486
Okay. That works. I wonder if it's also worth having links to a good explanation of how regexes work, and how Qt's ExtendedPatternSyntax works? They can do a lot, but it's a lot like code golf.
 

CodeYan

Member
Hm ... very interesting.
It seems like all this time I didn't notice that the regular expressions are currently only allowing to match one line at a time.
So you would have to add ".*" for each line in your file.
This is of course not feasible and something I will change.
Thank you very much for bringing this to my attention!

To unblock you I started a build where this behaviour is changed for the file condition.
Should finish in a few minutes and be available here:
You will have to be logged into GitHub to be able to download it.

I will clean this up in the other areas where regular expressions can be used to match multiple lines also.
Tried this build and it works fine for the issue. Strangely though, the same regex can be used on 1.17.5 and it works there, but not on 1.18.0. Did you just revert it?

As for "Enable use of (^) and ($)", having that option is good, although you many want to consider the wording regex101.com used, "^ and $ match start/end of line", although it is a tad longer ("...match line start/end" would reduce characters). IMO just saying "Enable use of (^) and ($)" makes it seem like they are actually not allowed until you check it, but doesn't it just mean that instead of ^ and $ being per line, it matches the start/end of the file when the option is disabled?

1662890800241.png
 

Lycanthrope -R-

New Member
Hm ... very interesting.
It seems like all this time I didn't notice that the regular expressions are currently only allowing to match one line at a time.
So you would have to add ".*" for each line in your file.
This is of course not feasible and something I will change.
Thank you very much for bringing this to my attention!

To unblock you I started a build where this behaviour is changed for the file condition.
Should finish in a few minutes and be available here:
You will have to be logged into GitHub to be able to download it.

I will clean this up in the other areas where regular expressions can be used to match multiple lines also.
Thanks. This works.

I hate to bring up another issue, but does the switcher access Image Slide Show controls? They don't seem to show up in media lists.
 

Warmuptill

Active Member
Tried this build and it works fine for the issue. Strangely though, the same regex can be used on 1.17.5 and it works there, but not on 1.18.0. Did you just revert it?
Sorry if I am misunderstanding, but are you saying that the "." was matching the new line characters in 1.17.5, but since the switch to 1.18.0 it no longer does? (Only in the test build above)
As for "Enable use of (^) and ($)", having that option is good, although you many want to consider the wording regex101.com used, "^ and $ match start/end of line", although it is a tad longer ("...match line start/end" would reduce characters). IMO just saying "Enable use of (^) and ($)" makes it seem like they are actually not allowed until you check it, but doesn't it just mean that instead of ^ and $ being per line, it matches the start/end of the file when the option is disabled?
Thanks for the suggestion - will change the wording!

Thanks. This works.

I hate to bring up another issue, but does the switcher access Image Slide Show controls? They don't seem to show up in media lists.
Thanks for the confirmation!

Image slide show sources are not supported, yet.
The changes to include support for them on the plugin side are prepared, but before merging them I want to wait for the next OBS release, which should fix the media states of image slide show sources being reported properly by OBS.

Depending on what you want to achieve you could maybe use the video condition to check for changes in the image slide show source.
 

Trenaldi

New Member
Yesterday I installed this and made a bunch of macros, and today I went to work on more macros to find they'd all disappeared and I have no idea what happened. My best guess is maybe putting my PC to sleep while advanced scene switcher was open destroyed them somehow? Anyway, I wish I knew what happened so I could avoid it.
 

Lycanthrope -R-

New Member
Image slide show sources are not supported, yet.
The changes to include support for them on the plugin side are prepared, but before merging them I want to wait for the next OBS release, which should fix the media states of image slide show sources being reported properly by OBS.
Understood. I just wanted to trigger the slide show to restart. I was able to do it by assigning a hotkey and having that be triggered. Thanks.
 

xPray4Deathx

New Member
You are still using the old version of the scene switcher that is not compatible with OBS 28:
14:25:11.048: Skipping module '../../obs-plugins/64bit/advanced-scene-switcher.dll' due to possible import conflicts

Can you try uninstalling the advanced scene switcher and then reinstalling the new version?
Alternatively manually install the files from the windows-x64.zip archive to the OBS folder.
Thank you for the reply, but the orignal post I made here was asking for help updating as it wont auto install and I looked over all the files and none was a auto installer from what I could tell. Followed what was asked, and was told, with respect what I already know, and was asked to do what I am stuck at. Funny. Not at you, the situation.

From the start..
Is there anyone who can help get this working again on my OBS. Since the latest update I can not get it to work.
@xPray4Deathx on twitter xPray 4 Deathx #1066 on discord.

Thank you.

Was asked..
What doesn't work? Is it something we just finished discussing? (scroll up) Or is it something else? More details would be nice.

Replied with..
Was not the issues listed above. Does not function since update. Reinstalled, it* did not run installer, searched through every file for a auto installer, was none. Can not get it to work now. If anyone can help me install, would be greatly appreciated. thank you

This is when we meet..
Can you please do the same and also share an OBS log file?

Have the new one DLed, just cant get it on my OBS. Would love help please, can jump on a discord call and stream.


Thank you so much for your time. Built my stream setup around a 2 camera auto rotation that is not working...sad face.
 

CodeYan

Member
Sorry if I am misunderstanding, but are you saying that the "." was matching the new line characters in 1.17.5, but since the switch to 1.18.0 it no longer does? (Only in the test build above)
Yes, doing ".*" will match for a file with multiple lines, and even doing "a\nb" in the file then using "a..b" as the regex matches it (although I have no idea why I need 2 dots; as far as I remember regex should not care about \r\n and would only see them as /n, but correct me if I'm wrong). I also retested this just now. And in the 1.18.0 release, the dot doesn't match the line break (and you still have to use \r\n"). The test build actually fixed this and now you only need \n.

Retesting your test build made me realize that the "." actually still doesn't match the line break, but ".*" only works because you're no longer doing a full match for the whole file (so .* only has to match the first line). Which imo is desirable, since you can always do a full match with "^" and "$" now. If the regex still did a full match for the file, then we would have to put ".*" both at the start and end, which is strange to me.

But this also means that you don't need to do ".*" anymore. ".?" would have the same effect. In fact, you could also just keep the regex blank, and content changed will still activate whenever the file is changed. Though now I'm confused. What would be the difference between "modification date changed" and "date changed" in this case? Also, check if a blank regex was actually regression.

About the dot not matching line break, I think the dot should not match line breaks by default. In the regex flavors I used, that was never a default, and you'd have to enable a flag. On this note, does the regex flavor you use allow putting flags within the regex? The js syntax afaik is "(?s)", where s is the DOTALL flag. "(?i)" would disable case sensitivity. This would allow others to use the regex flags if they want (although you could always just do "(.|\n)+").

Also, I noticed that the browse button in the macro condition just defaults to the obs path. Would be nice if it defaults to the directory where the previously selected file was from.
 

Warmuptill

Active Member
Yesterday I installed this and made a bunch of macros, and today I went to work on more macros to find they'd all disappeared and I have no idea what happened. My best guess is maybe putting my PC to sleep while advanced scene switcher was open destroyed them somehow? Anyway, I wish I knew what happened so I could avoid it.
The settings are saved as part of the scene collection.
Do you maybe accidentally or on purpose switch to a different one?

Thank you for the reply, but the orignal post I made here was asking for help updating as it wont auto install and I looked over all the files and none was a auto installer from what I could tell. Followed what was asked, and was told, with respect what I already know, and was asked to do what I am stuck at. Funny. Not at you, the situation.

From the start..


Was asked..


Replied with..


This is when we meet..


Have the new one DLed, just cant get it on my OBS. Would love help please, can jump on a discord call and stream.


Thank you so much for your time. Built my stream setup around a 2 camera auto rotation that is not working...sad face.
Sorry I misunderstood your request then.
Usually OBS is installed to "C:\Program Files\obs-studio" - but I cannot say with certainty that this is the case for you also.
Once you have located the folder in which OBS was installed into, extract / merge the contents of the windows-x64.zip archive into this folder.
Does this clear things up?

Also, I noticed that the browse button in the macro condition just defaults to the obs path. Would be nice if it defaults to the directory where the previously selected file was from.
Already prepared for the next release :)

About the dot not matching line break, I think the dot should not match line breaks by default. In the regex flavors I used, that was never a default, and you'd have to enable a flag
I could also just add an additional checkbox to allow "." to match the new line also.

On this note, does the regex flavor you use allow putting flags within the regex? The js syntax afaik is "(?s)", where s is the DOTALL flag. "(?i)" would disable case sensitivity. This would allow others to use the regex flags if they want (although you could always just do "(.|\n)+").
Qt does not support setting the flags in the regex text itself but requires passing these option when constructing the QRegularExpression object.

Yes, doing ".*" will match for a file with multiple lines, and even doing "a\nb" in the file then using "a..b" as the regex matches it (although I have no idea why I need 2 dots; as far as I remember regex should not care about \r\n and would only see them as /n, but correct me if I'm wrong). I also retested this just now. And in the 1.18.0 release, the dot doesn't match the line break (and you still have to use \r\n"). The test build actually fixed this and now you only need \n.

Retesting your test build made me realize that the "." actually still doesn't match the line break, but ".*" only works because you're no longer doing a full match for the whole file (so .* only has to match the first line). Which imo is desirable, since you can always do a full match with "^" and "$" now. If the regex still did a full match for the file, then we would have to put ".*" both at the start and end, which is strange to me.
Thanks a lot for performing these tests and reporting the results!
I really do appreciate it a lot!

So to summarize:
  • Previously "." did match \n by default
  • Previously the regex always performed a full match
I think the best approach to go forward would be to add options for users to configure the regex behaviour to their liking, but to also make sure to break as few setups as possible.
So I will make sure to still perform a full match for existing regular expressions but add the option of partial matches for new ones.

A build with these changes will be available here in a few minutes

I will probably not get around to testing in the next few days though - so use at your own risk :P
 

Trenaldi

New Member
The settings are saved as part of the scene collection.
Do you maybe accidentally or on purpose switch to a different one?
I have not changed scene collections, but I think my new best guess is maybe I opened the old OBS version by mistake and borked it that way.

The new one I have as portable for testing it out, and so maybe I just went through the start menu without thinking. I wouldn't put that past me. I've rebuilt most of my macros, and exported the scene switcher settings and a fresh backup of my scene collection, so hopefully now I'll be safe from whatever I did.
 

xPray4Deathx

New Member
Sorry I misunderstood your request then.
Usually OBS is installed to "C:\Program Files\obs-studio" - but I cannot say with certainty that this is the case for you also.
Once you have located the folder in which OBS was installed into, extract / merge the contents of the windows-x64.zip archive into this folder.
Does this clear things up?


This has been tried, that's why I am reaching out, am at a point where I have tried it all and need help to install. Going in circles here, mentioned that this has been tried.


Is there anyone that can take less than 5 mins to help, like LIVE help.
 

CodeYan

Member
The settings are saved as part of the scene collection.
Do you maybe accidentally or on purpose switch to a different one?


Sorry I misunderstood your request then.
Usually OBS is installed to "C:\Program Files\obs-studio" - but I cannot say with certainty that this is the case for you also.
Once you have located the folder in which OBS was installed into, extract / merge the contents of the windows-x64.zip archive into this folder.
Does this clear things up?


Already prepared for the next release :)


I could also just add an additional checkbox to allow "." to match the new line also.


Qt does not support setting the flags in the regex text itself but requires passing these option when constructing the QRegularExpression object.


Thanks a lot for performing these tests and reporting the results!
I really do appreciate it a lot!

So to summarize:
  • Previously "." did match \n by default
  • Previously the regex always performed a full match
I think the best approach to go forward would be to add options for users to configure the regex behaviour to their liking, but to also make sure to break as few setups as possible.
So I will make sure to still perform a full match for existing regular expressions but add the option of partial matches for new ones.

A build with these changes will be available here in a few minutes

I will probably not get around to testing in the next few days though - so use at your own risk :P
I appreciate the update and being able to use the other regex options. Some comments:
1663040420457.png
1663040339193.png

- combining the "matches" with "content changed" and the other is good.
- should be ". matches newlines" (no "is")
- partial match and case insensitive, i think that's an option that should be usable even if regex is not enabled. perhaps the partial match can also be combined with the "matches" dropdown? so the choices could be "contains", "fully matches", "modification date changed", etc. on that note, i'd also personally like "contains" to be the default, but i don't really use the File macro, so I don't know what's more common.
- it also makes the condition frame too big. the ui is not very compact even with dark theme (i'm talking about general ui, regardless of macro condition type).
- one option would be to have a pop up where they can set the regex options, so it doesn't use space. kinda like the settings icon
1663040636860.png


Also tested the regex options (except the ExtendedPatternSyntax, because I don't know that), and they seem to be working fine.

Thank you again for the continuous development of a great plugin!
 

Warmuptill

Active Member
I appreciate the update and being able to use the other regex options. Some comments:
View attachment 86559View attachment 86558
- combining the "matches" with "content changed" and the other is good.
- should be ". matches newlines" (no "is")
- partial match and case insensitive, i think that's an option that should be usable even if regex is not enabled. perhaps the partial match can also be combined with the "matches" dropdown? so the choices could be "contains", "fully matches", "modification date changed", etc. on that note, i'd also personally like "contains" to be the default, but i don't really use the File macro, so I don't know what's more common.
- it also makes the condition frame too big. the ui is not very compact even with dark theme (i'm talking about general ui, regardless of macro condition type).
- one option would be to have a pop up where they can set the regex options, so it doesn't use space. kinda like the settings iconView attachment 86560

Also tested the regex options (except the ExtendedPatternSyntax, because I don't know that), and they seem to be working fine.

Thank you again for the continuous development of a great plugin!
Thanks again for your help!
I will try to incorporate your suggestions into the next release :)

- should be ". matches newlines" (no "is")
Thanks! :)
partial match and case insensitive, i think that's an option that should be usable even if regex is not enabled.
I agree, but I will put in the backlog for now.
- it also makes the condition frame too big. the ui is not very compact even with dark theme (i'm talking about general ui, regardless of macro condition type).
- one option would be to have a pop up where they can set the regex options, so it doesn't use space. kinda like the settings icon
Sounds good - i'll change it to the pop up approach.
Although I liked being to able to "quickly" change a regex setting without having to open a separate dialog, but I don't see the need for it.
Once a user has configured a regex, it is unlikely to change. :P

A build with this change is available here:

This has been tried, that's why I am reaching out, am at a point where I have tried it all and need help to install. Going in circles here, mentioned that this has been tried.


Is there anyone that can take less than 5 mins to help, like LIVE help.
Maybe send me a PM and we can try to figure out a time.
 
Last edited:
Top