Copy link to clipboard
Copied
Hi everyone,
I’m working on a project where I need to generate about 60 randomized Bingo cards based on an existing Illustrator design template (I’ve already designed one card).
I’m wondering whether Illustrator can automate this using Variables/Data Sets with an Excel (CSV) file, or if there’s a better workflow for generating multiple versions.
Many thanks!
not sure how the file is built but someone had asked something similar a while ago and I made a script that would shuffle the contents of a textframe. the basic idea being to design all the bingo content in a single text frame and then this would shuffle them and you can save them. pushing this script further you could shuffle the content and save it and loop through that multiple times.
if(app.activeDocument.selection.length==1 && app.activeDocument.selection[0].typename=="TextFrame"){
var ...
Copy link to clipboard
Copied
not sure how the file is built but someone had asked something similar a while ago and I made a script that would shuffle the contents of a textframe. the basic idea being to design all the bingo content in a single text frame and then this would shuffle them and you can save them. pushing this script further you could shuffle the content and save it and loop through that multiple times.
if(app.activeDocument.selection.length==1 && app.activeDocument.selection[0].typename=="TextFrame"){
var StartContents = app.activeDocument.selection[0].contents
var ShuffledContents = shuffleArray(StartContents)
app.activeDocument.selection[0].contents = ShuffledContents
} else {
alert("Whoops!\nPlease select a text frame and try again.")
}
/* Randomize array in-place using Durstenfeld shuffle algorithm */
function shuffleArray(Arr) {
if(typeof Arr=="string")Arr = Arr.split("")
for (var i = Arr.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = Arr[i];
Arr[i] = Arr[j];
Arr[j] = temp;
}
return Arr.join("")
}edit: previous post
Copy link to clipboard
Copied
Thank you so much!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now