Advanced Scene Switcher

Advanced Scene Switcher 1.29.0

Reaperz

New Member
any thoughts on how to trigger the refresh browser source cache button automatically on a specific browser source prior to running through the rest of the list?
 

JonathanC09

Member
[EN] Hello, I wanted some help creating a macro. one that activates and deactivates the one source based on whether the first Friday of the current month.
[ES] Buenas, quería algo de ayuda para crear una macro. una que active y desactive la una fuente en base a si el primer viernes del mes actual.

something like that / algo así:

If today.dayOfWeek = friday and today.dayOfMonth <=7
then image01.visibility = true
else image01.visibility = false

With the part about if it's Friday there is no problem, the advanced switcher gives it to me for free, but I don't know how to do the other check /
con la parte de si es viernes no hay problema, el advanced switcher me lo da gratis, pero con se como hacer la otra comprobación

sorry for the syntax, I really don't know much about programming/
perdón por la sintaxis, realmente no sé mucho de programación.
 

AaronD

Active Member
adv. scene switcher can djing single videos?
Each video by itself in a scene, as the only source in that scene. Then switch scenes as desired to show the videos:
  • If Any Media on Current Scene is Playing and Time Remaining shorter than X
    • Switch to Random Scene with Transition length X
That gives a nice transition from one to the next while both are playing.

Or a series of:
  • If Any Media on Scene A is Playing and Time Remaining shorter than AB
    • Switch to Scene B with Transition length AB

My solution is atm, a VLC Playlist. The Playlist is created, every time you save the config. I tested a little bit, and I use the End status with a counter. after every video is finished, ended can trigger something. so the playlist is just paused, when the scene is switched to "commercial/trailer" or so.
Glad you got something to work.
 

AaronD

Active Member
If today.dayOfWeek = friday and today.dayOfMonth <=7
...

With the part about if it's Friday there is no problem, the advanced switcher gives it to me for free, but I don't know how to do the other check /
con la parte de si es viernes no hay problema, el advanced switcher me lo da gratis, pero con se como hacer la otra comprobación
Try this:
1739139066658.png

As you say, the Friday part is easy. The trick is restricting it to just the first week.

The Pattern match is a "regular expression". (google that)
  • . matches anything.
  • 0 must match a literal 0. (most characters are like that)
  • [1-7] must match a single character that is somewhere between 1 and 7 inclusively.
The only thing that can match all of that, is the first week of the month.

---

EDIT: Should be an AND instead of an OR in the screenshot. Sorry for any confusion.
 
Last edited:

BrenFu

New Member
When reading variables from json data (Action -> Variable -> Extract json field with name), how do you specify a path to the json file that you wish to read from?
Or is this action hardcoded to read from a particular json, and if so, where is it?
 
I have a webpage I am creating to control OBS.

Is there a way to send the value of a variable from OBS to Javascript, so I can perform and actiion based on the sent variable?
 

yukon92

New Member
Is there a way to trigger a macro in Advance Scene Switcher directly from a scene config itself without having to rely on it detect a specific condition?
 

Destroy666

Member
When reading variables from json data (Action -> Variable -> Extract json field with name), how do you specify a path to the json file that you wish to read from?
Or is this action hardcoded to read from a particular json, and if so, where is it?
There is no JSON file. You are extracting from a given variable into the same variable. And IIRC only 1 level of depth is available, so to get to let's say `some.value.deep.inside` you have to run the action 4 times, step by step. Then, if you also wanted `some.other.value.deep.inside`, you would need to use 2 variables with full JSON, which you can read from file with e.g. FIle condition (content macro property). Which makes it barely useful but that's the only JSON action available as of now.

Well, you can always use Run action with e.g. PowerShell's ConvertFrom-Json etc. and read the standard output from macro property into a variable, which might be more convienient under more complex circumstances - 4 actions to read 2 properties deep inside into vars instead of ~10+.
 
Last edited:

Laczkó

New Member
I'm trying to achieve if I change the file path of a text source then the file path of a video source would change to the same (except the extension of the file name). I started with a variable. I made a macro that write the changed path into the variable then change the extension, but I can't figure out how to use the variable to define the file path of a video source. Is there a way to do that? Or any other idea how the achieve this goal?
 
I need a way to communicate hotkey strokes to via OBSwebsocket, to Javascript, for a "Streamdeck-style" browser tool I am developing.

Is there a way to do this in Advanced Scene Switcher using the Websocket feature?
 

AaronD

Active Member
I need a way to communicate hotkey strokes to via OBSwebsocket, to Javascript, for a "Streamdeck-style" browser tool I am developing.

Is there a way to do this in Advanced Scene Switcher using the Websocket feature?
You can have a bunch of macros, each of which responds to a single hotkey and sends a specific WebSocket event through the host OBS's server. Then your app can connect to OBS's Websocket server and receive those events.

For the return path, you can also have a bunch of macros that listen for specific WS requests...

Or, is there a reason you can't have your app receive keystrokes directly?
 
AaronD wrote:
"You can have a bunch of macros, each of which responds to a single hotkey and sends a specific WebSocket event through the host OBS's server. Then your app can connect to OBS's Websocket server and receive those events."

I am trying to figure out how to formulate a message in the Websocket feature of AdvSS.
I already have the OBSWebsocket connection established, and can see in the Console of the browser page that it is communicating.

AaronD wrote:
"Or, is there a reason you can't have your app receive keystrokes directly?"

My IT dept has blacklisted the use of AutoHotkey.
 

AaronD

Active Member
I am trying to figure out how to formulate a message in the Websocket feature of AdvSS.
I already have the OBSWebsocket connection established, and can see in the Console of the browser page that it is communicating.
I think @Warmuptill would be the most knowledgeable on this. In the meantime, does Wireshark give you something useful? Get it communicating between two instances of Adv. SS in separate instances of OBS, and see what actually goes across? (only one instance has the WS server active, and the other connects to that)

My IT dept has blacklisted the use of AutoHotkey.
Why???

At any rate, I don't think you'd even need that. Direct from keyboard (as the OS interprets it) to your app. Nothing in between.
 
I think @Warmuptill would be the most knowledgeable on this. In the meantime, does Wireshark give you something useful? Get it communicating between two instances of Adv. SS in separate instances of OBS, and see what actually goes across? (only one instance has the WS server active, and the other connects to that)


Why???

At any rate, I don't think you'd even need that. Direct from keyboard (as the OS interprets it) to your app. Nothing in between.

I am told IT blacklists it because it can "modify registry entries and sys internals".

I am not aware of Wireshark, wbut will investigate it.
What I have seen is that the web app only recognizes the keystrokes when it is the active window.

Yeah... hoping @Warmuptill can chime in here.
 

Warmuptill

Active Member
I need a way to communicate hotkey strokes to via OBSwebsocket, to Javascript, for a "Streamdeck-style" browser tool I am developing.

Is there a way to do this in Advanced Scene Switcher using the Websocket feature?
Unfortunately, my experience with JavaScript / TypeScript is very limited.

You can find an example how to send Advanced Scene Swwitcher OBS websocket vendor requests in the stream deck plugin for Advanced Scene Switcher using obs-websocket-js version 5.0.6:

Just note that in the above the example the message is "StreamDeckKeyEvent" while you probably want to use "AdvancedSceneSwitcherMessage" if you are intending to use these types of actions / conditions.

1740426771130.png


Note that it is also possible to receive obs websocket vendor "events" from the Advanced Scene Switcher, if you want to "send out" a message from the plugin to your JS application.

The vendor event name would be "AdvancedSceneSwitcherEvent" in this case and it would correspond to these conditions / actions:

1740427031864.png


The StreamDeck plugin also has an example on how to handle vendor events:

(Note that in the above example "AdvancedSceneSwitcherStarted" and "AdvancedSceneSwitcherStopped" are being demonstrated instead of "AdvancedSceneSwitcherEvent")

A few more examples regarding the general structure of the messages can be found here in the wiki:

I hope that helped!
And sorry for not replying here in such a long time!
 
Unfortunately, my experience with JavaScript / TypeScript is very limited.

You can find an example how to send Advanced Scene Swwitcher OBS websocket vendor requests in the stream deck plugin for Advanced Scene Switcher using obs-websocket-js version 5.0.6:

Just note that in the above the example the message is "StreamDeckKeyEvent" while you probably want to use "AdvancedSceneSwitcherMessage" if you are intending to use these types of actions / conditions.

View attachment 111636

Note that it is also possible to receive obs websocket vendor "events" from the Advanced Scene Switcher, if you want to "send out" a message from the plugin to your JS application.

The vendor event name would be "AdvancedSceneSwitcherEvent" in this case and it would correspond to these conditions / actions:

View attachment 111637

The StreamDeck plugin also has an example on how to handle vendor events:

(Note that in the above example "AdvancedSceneSwitcherStarted" and "AdvancedSceneSwitcherStopped" are being demonstrated instead of "AdvancedSceneSwitcherEvent")

A few more examples regarding the general structure of the messages can be found here in the wiki:

I hope that helped!
And sorry for not replying here in such a long time!

Thank you for the great response, @Warmuptill !

I will check those suggestions ou!!
 

Prestorec

New Member
Hello guys,
Im trying to make a win lose variable that gets saved into a .txt file, is this possible? I am kind of lost with how variables work and need some help.
The thing I want to do exactly is that I have a score.txt which flaxuates from 0 to 1000. What I want is an initial variable to get that number from the score.txt file and save it (for example lets say its 150) and then compare it again (every 3s for instance) with the same score.txt file which lets say gets update to 175 later variable . If later variable<initial variable then add +1 to a win.txt file and update initial variable value to 175 else +1 to a lose.txt file and update initial variable value to (score.txt lower value). Does anyone have any idea how to achive that? Thank you in advance btw!
 
Last edited:

Destroy666

Member
Hello guys,
Im trying to make a win lose variable that gets saved into a .txt file, is this possible? I am kind of lost with how variables work and need some help.
The thing I want to do exactly is that I have a score.txt which flaxuates from 0 to 1000. What I want is an initial variable to get that number from the score.txt file and save it (for example lets say its 150) and then compare it again (every 3s for instance) with the same score.txt file which lets say gets update to 175 later variable . If later variable<initial variable then add +1 to a win.txt file and update initial variable value to 175 else +1 to a lose.txt file and update initial variable value to (score.txt lower value). Does anyone have any idea how to achive that? Thank you in advance btw!
You can do exactly what you described. If you have trouble with something specific, it'd be great if you specified what. Variable actions/conditions help with var changes like setting, incrementing or checking if bigger, File condition + macro properties to get changes and lastly either Timer condition with every 3s comparison or changing macro settings to wait at least 3 seconds between runs.
 
Top