$.evalFile(myPath); evaluates the source.txt, and this declares your arrays inside your expression.
Past that point you no longer need to eval anything.
Just use arrayname[item number] instead of eval(arrayname)[item number].
For instance Sydney, which will return 'Languages:'
Hi Xavier, thank you for your response.
I have changed the expression to remove the eval(), and this is what it looks like now:
myPath = "/Volumes/VIdeo Master/Videos/Find Yours Project b0ss/source.txt";
thisComp.layer("CITY PICKER").text.sourceText[Math.round(effect("Slider Control")("Slider"))];
However when the 'City Picker' source text is 'Sydney', the above code will return 'n'
The only success I have had so far is to rename the text layer to the array name as shown below, but the layer name is not as dynamic as a keyframeable paramater
i realise i completely misunderstaood the role of CITY PICKER, hence your question.
Then you need the eval. Sorry.
In your original expression, try replacing eval(thisComp.layer("CITY PICKER").text.sourceText)[...]
by eval(thisComp.layer("CITY PICKER").text.sourceText.value)[...]
If my guess is rigth, AE expressions allow some amibiguities between properties and their value, but eval (which is a native js function) doesn't.
So your original expression starts by evaluating a property while it should evaluate a string ('Sydney', etc...)
THANK YOU!! Perfect!