String Array from Script 2024

Hi everyone! Good day!

I’m running into this issue when trying to upload/publish my effect on the dashboard (image below).

I’m trying to pass a reactive number from patch editor as a driver to call a string from an array. That string is for a 2dtext text input.

Basically I have 10,000 different strings in my script and want the random number input (editorToScriptVar) to call a string within the script quote (scriptToEditorVar).

Trying to wrap my head around this but have not found a solution.

Thanks in advance!


const P = require('Patches');
const S = require('Scene');
const R = require('Reactive');
const D = require('Diagnostics');

(async function () { 

  let x = await P.outputs.getScalar('editorToScriptVar');

  x.monitor({fireOnInitialValue: true}).subscribe((snapshot) => {

    let quotes = [ //strings list of 10,000 items would be here// ];

    P.inputs.setString('scriptToEditorVar', quotes[snapshot.newValue]);