-
Need to customize Dan’s Counter Expressions script
Here’s the script – https://www.motionscript.com/design-guide/counter.html.
I’ve got the script written as such –
var x ="" ;
for (j=0; j<12; j++)
{
valLength = myArray[j].length;
var s = myArray[j];
if (commas){
decimals = " ";
if (Ndecimals > 0){
var decimals = s.substr(-(Ndecimals + 1));
s = s.substr(0,s.length - (Ndecimals + 1));
}
outStr = s.substr(-s.length, (s.length-1)%3 +1);
for (i = Math.floor((s.length-1)/3); i > 0; i--){
outStr += thousandSeparator + s.substr(-i*3,3);
}
x=x + prefixArray[j] + outStr + decimalSeparator + myArray[j].substr(valLength-Ndecimals) + suffixArray[j] + "\r"
}
}All works well but I would now like to add conditionals to check if prefixArray[j]and/or suffixArray[j] are enabled. These two arrays are originally contained in their respective layers – reading their data is thus far accurate and working as expected. I would like a user to disable (switch off their visibility switch) the layers, independently , should they not want one or both of these arrays as part of the final line in the existing script (above).
I’m having difficulty incorporating the if…then conditionals required to pull this off.
TIA
RoRK
Latest AE Workshop – MoGraph Intensity – Shapes & TextIntensive mocha & AE Training in Singapore and Other Dangerous Locations
Imagineer Systems (mocha) Certified Instructor
& Adobe After Effects CS6 ACE/ACI