Hi everyone,
I currently have a custom module (my very first custom module ) which is reading a text file:
var fs = nativeRequire('fs')
module.exports = {
oscOutFilter:function(data){
// Filter outgoing osc messages
var {address, args, host, port} = data
if (address === '/Hello') {
const fs = nativeRequire('fs');
fs.readFile('/Users/swayrian/Hello.txt', 'utf8', (err, data) => {
if (err) {
console.error(err);
return;
}
console.log(data);
});
return // bypass original message
}
// return data if you want the message to be processed
return {address, args, host, port}
}
}
In the console it says Hello
when I press a button which is set to the address /Hello
but how can I then send back that Hello
text into a text widget ?
So my goal would be to press a button on OSC which would read a text file and then send the content back to OSC on a text widget.