On loading of template, send osc?

#1

Is it possible to send an osc/midi command when loading/opening a template (before hitting any buttons etc, just load template and bam, command is sent)?

#2

Something like --state ? https://openstagecontrol.ammd.net/docs/getting-started/#options

#3

If you’re looking for a way to send arbitrary commands (not emitted by the widgets in your session), you need to write a custom module, here’s a basic example:

module.exports = {

    init: function(){

        // executed once when the server starts
        send('127.0.0.1', 5555, '/server/started')

        app.on('sessionOpened', (data, client)=>{

            // executed each time a session is opened
            // as from v0.44.0, this will only apply
            // for sessions loaded from the server's filesystem 
            
            send('127.0.0.1', 5555, '/session/opened', data.path)

        })

    }

}

https://openstagecontrol.ammd.net/docs/custom-module/

#4

Worked perfectly. Thank you!