Skip to main content
Participant
May 12, 2022 3:22 PM UTC
Question

Having trouble with return values from csInterface.evalscript

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 is closed to new replies. Start a new post to keep the conversation going.