remote control: add /SCRIPT command to run scripts remotely

This commit is contained in:
jean-emmanuel 2021-05-05 09:48:22 +02:00
parent e417399158
commit 9844804d98
4 changed files with 19 additions and 2 deletions

View file

@ -17,6 +17,9 @@
- editor
- make tree item blink when hitting "Show in tree"
- remote control
- add `/SCRIPT` command to run scripts remotely
## 1.9.3
- bug fixes

View file

@ -2,7 +2,7 @@
"name": "open-stage-control",
"productName": "Open Stage Control",
"description": "Libre and modular OSC / MIDI controller",
"version": "1.9.3",
"version": "1.9.4",
"author": {
"name": "Jean-Emmanuel Doucet",
"email": "jean-emmanuel@ammd.net"

View file

@ -217,3 +217,9 @@ Save current session to `path.json`. If `path.json` is omitted, current session'
#### `/TABS tab_id1 tab_id2 ...`
Open the tabs designated by the id parameters.
----
#### `/SCRIPT code`
Run code as if it where executed by a script widget.

View file

@ -4,7 +4,8 @@ var {updateWidget} = require('./editor/data-workers'),
stateManager = require('./managers/state'),
sessionManager = require('./managers/session'),
deepExtend = require('deep-extend'),
notifications = require('./ui/notifications')
notifications = require('./ui/notifications'),
uiConsole = require('./ui/ui-console')
var callbacks = {
'/EDIT': function(args) {
@ -283,6 +284,13 @@ var callbacks = {
}
}
}
},
'/SCRIPT': function(args) {
if (!Array.isArray(args)) args = [args]
uiConsole.script.setValue(args[0], {sync: true, send: true})
}
}