Read JSON from a Widget Script

That sounds great...
But I tried several setting but nothing worked.
Where do I have to put the command?

Here I have an error. Is the path different than in the custom-modul?

I also tried to set the remote-root path direct to the folder, where the vepKeys.json file is

But the same error there
Bildschirmfoto 2022-11-06 um 08.08.39

Try without the quotes.

Unbelievable how sometimes little things can keep you busy for hours.
It works... Vou are great, very thanks... With this method I was even able to take out the following command:
if (typeof vepKeys === 'string') vepKeys = JSON.parse(vepKeys)

My code looks now like this:

var instrumentCode = parseInt(get("text_code", value))
var vepKeys = get('variable_vepKeys')
//if (typeof vepKeys === 'string') vepKeys = JSON.parse(vepKeys)
var s1 = parseInt(vepKeys.keys[instrumentCode].s1) 
var e1 = parseInt(vepKeys.keys[instrumentCode].e1) 
var sk1 = vepKeys.keys[instrumentCode].sk1
var ek1 = vepKeys.keys[instrumentCode].ek1
set ("range_2A_art_keyboard", [s1,e1+1])
set ("text_2A_art_range_key_start", sk1)
set ("text_2A_art_range_key_end", ek1)

I am really excited...

Well the quotes could ignored by osc, I'll change this in next release.

On my touchscreen I need to do a reload from my HTTP Viever so that my variable_vepKeys is doing a reload from the JSON file.
The help from "DMDComposer" with

send("/RELOAD")

unfortunately does not work here. (Or I do something wrong).
Is it possible with a button widget to send a command to make my variable widget do a reload?

If you want to make the clients reload from the custom module you should call

receive('/RELOAD')

Sorry Jean-Emmanuel, I must have expressed myself wrongly.
I want to press a button in the client to reload the variable widget without having to go through the custom modul.
Is this possible at all?

You could call this from the widget

send('127.0.0.1:8080',  '/RELOAD') // server_ip:port 

as @DMDComposer suggested but I don't recommend sending messages back to the server this way, the cleanest way would be to do something like that in the widget's script:

send('ip:port', '/RELOAD_REQUEST') // any target as first argument, we'll bypass the message in the custom module

and reply back with the custom module

module.exports = {
  oscOutFilter: function(data) {
    if (data.address === '/RELOAD_REQUEST') {
      receive('/RELOAD', {clientId: data.clientId})
      return // bypass original message
    }
    return data
  }
}

Now I could also expose the reload function in scripts...

I miss something...
script is sending (I see in the console.log entry "hallohallo")

But I do not see the console.log entry "denisdenis" in the server console.

custom-module.js.zip (3.1 KB)

The when no target is provided to the send() fonction it doesn't do anything unless the widget has a target. I edited my previous reply to fix some mistakes.

With the IP Address it is working great.
Thanks you