Bash script to launch O-S-C

Hi there!

Is it possible to stack the settings of the server into separate lines? Thank you.

Edit:
Found the answer here.

Edit 2:
Actually, I thought I did, but didn't :sunglasses: . Still looking for a way...

Edit 3:
Found it. For real this time (here). According to the referenced page, a backslash is required as the last character on the line (in order to continue a command on the following line).

Edit 4:
According to Edit 3 the following should've worked, but it doesn't....

Screenshot (Sublime Text 3 bash script)

Terminal error when running the bash script.
aaa:~ alin$ pkill -9 "node" // (for terminating all node processes)


aaa:~ alin$ /Users/alin/Documents/MyAll/DW/03\ -\ Mahler/Scripting\ -\ Applescript\ -\ Typinator\ and\ Others/Bash\ scripting/Open\ O-S-C\ in\ node/O-S-C-NODE.sh


node:internal/modules/cjs/loader:944
  throw err;
  ^

Error: Cannot find module '/Applications/O-S-C/open-stage-control-1.13.2-node--port'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
    at Function.Module._load (node:internal/modules/cjs/loader:774:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}


aaa:~ alin$ 

Edit 5:
This will work:

Bash script
#!/bin/bash

node /Applications/O-S-C/open-stage-control-1.13.2-node \
--port 8080 \
--midi mtc list sysex "Network Session 1:Network Session 1,Network Session 1" "Network Session 2:Network Session 2,Network Session 2" SessionKiano:SessionKiano,SessionKiano SKiano-A:SKiano-A,SKiano-A SKiano-B:SKiano-B,SKiano-B SKiano-C:SKiano-C,SKiano-C UMA25S:UMA25S,UMA25S path=/usr/local/bin/python3 \
--no-gui true \
--remote-root '/Users/alin/Documents/MyAll/DW/03 - Mahler/OSC remote-root' \
--custom-module '/Users/alin/Documents/MyAll/DW/03 - Mahler/OSC remote-root/Custom module/CustomModule1.js' \
--osc-port 7001 \
--debug true
1 Like

Yes, backslash is the way (to escape the newline character that follows) :slight_smile:

1 Like

Hi again! Do you know by any chance if the bash script I wrote can run O-S-C and put it to the background? I would like to be able to close the terminal after I run the script.

Currently, when I try to exit, I get this message:

Screenshot (are you sure...?)

Hi

An idea : tmux

1 Like