The latest beta version of ScriptPlayer contains a small command line interface that allows you to control an already running instance of ScriptPlayer.
Why would I want to use that?
With this new feature you can control ScriptPlayer from another program, custom input device or whatever.
E.g. you could control SP from your programmable keyboard keys, stream deck, selfmade arduino input device, build a custom webinterface or alexa skill etc.
Which commands are available?
Currently most of the commands that are available are the ones that you can find in the “Input Mappings” settings. You will need the “Command ID” which will show up in a tooltip when you hover a row (right click on a command to copy it to your clipboard)
All others will be documented here when I add them.
How do I use it?
The latest beta version contains two programs called “spcli.exe” (Script Player Command Line Interface) and “spcon” (ScriptPlayer Console). These two programs are mostly identical, I’ll highlight the differences a bit later. You can start the programs with the parameters -c <CommandId>
to execute a single command. If ScriptPlayer is already running, it will execute the command. To start an interactive session and send multiple commands, simply start the program with -i
.
spcli will run “invisible” and will not create a console window. If you do not specify -c
or -i
it will assume the single command mode -c
by default.
spcon will start a new console or use the existing one (e.g. when started from the windows command line) and assume the interactive mode -i
by default.
You can run both programs in both modes, but spcli is meant for single commands and spcon for interactive mode.
If you want to toggle playback for example:
"C:\Program Files (x86)\ScriptPlayer\spcli.exe" -c TogglePlayback
"C:\Program Files (x86)\ScriptPlayer\spcli.exe" TogglePlayback
or in interactive mode
"C:\Program Files (x86)\ScriptPlayer\spcon.exe" -i
TogglePlayback
"C:\Program Files (x86)\ScriptPlayer\spcli.exe"
TogglePlayback
How does it work?
spcli.exe and spcon are tiny little programs that take every argument you give it (except for -h and -c) and pass it on to ScriptPlayer via local named pipes. If ScriptPlayer is not running, nothing will happen.
What’s next?
If you have any suggestions, feedback or would like to see certain commands added, let me know.
Wishlist so far: