"script_message_rcv" will execute when receiving a message from another script using the this.$api.command.script_message_send
API function.
script_message_rcv((caller_reference_name, message, reply_callback) => {
console.log('got a message from' + caller_reference_name, message);
reply_callback('I got your message!')
});
caller_reference_name
: The reference name of the script sending the message.message
: Can be a string, object or array.reply_callback
: (Optional) Used to reply to the message. Parameters are dependent on what is being defined when sending the message.