Maybe you should post over at
and explain the Layer structure and font setting, maybe post a layered file or at least a screenshot with the Layers Panel visible.
Edit: Sorry, I had forgotten which exact Forum I was browsing …
But please explain the Layer structure and font setting, maybe post a layered file or at least a screenshot with the Layers Panel visible nonetheless.
What is the exact procedure you intend to use anyway?
Create documents with the numbers and then print in one go, change the numbers in a Type Layer and print each variation immediately, …?
So, to come up with the string is pretty easy. You get 16 digits from what I'm going to show you.
myString = Math.random().toString().replace(/\./, '').slice(0,12); (the second value in the replace method is actually two single quotes to denote a nothing value, not double quotes.)
So, the Math.random() pumps out a random string of numbers between 0 and 1.
Now we are going to change it into a string with the toString method.
Then replace the decimal point to remove it form the string with the replace method. Not sure if you want to check for a string starting with zero's or not. Not sure how the random numbers need to be formatted. Then we will take off the extra characters with the slice method.
Hope this helps, enjoy!
You may have overlooked that Math.random can result in "shorter" numbers (if the last couple ones would be 0), so it may be necessary to "fill them up" on occasion.
good call c.pfaffenbichler. Thank you for pointing that out.
okay, redo that line. Okay, ran this in a for loop 200,000 times, it always generates a 12 digit number
number = Math.floor(Math.random()*900000000000) + 100000000000;