Skip to main content
Participant
May 12, 2022
Question

Having trouble with return values from csInterface.evalscript

  • May 12, 2022
  • 0 replies
  • 118 views
Hi! I'm trying to get this function to return the value of the result variable, but am have some sync/async problems. Do you know the solution? Will you share it with me? Thanks!

 

async function executeScript(remoteData, localData, scriptData) {

    const script = `evaluationStation("${remoteData}","${localData}","${scriptData}");`
    const returnMe = await csInterface.evalScript(script, (result) => {
            console.log('This is my result: '+ result);
            return result;
    });

    console.log(returnMe)
    return returnMe;
}

 

This topic has been closed for replies.