I've cobbled together a simple script to generate a series of files from a template with text added. The problem is that the text is way off the artboard no matter what co-orinates I put as the text.position.
How do I get the text in a certain position ?
Here is my code below:
#target Illustrator
function ProcessFiles()
{
var IllustratorSaveOptions
const alphabet= ["A", "B", "C", "D", "E", "F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];
for(firstletter = 0; firstletter < 1; firstletter++){
for(secondletter = 0; secondletter < 26; secondletter++){
File = app.open(new File("E:/Products/Stencils/TEST/CUS_FORK_01.ai"));
var doc = app.activeDocument;
var text = app.activeDocument.layers[0].textFrames.add();
text.textRange.characterAttributes.size = 1200.5;
text.textRange.characterAttributes.textFont = app.textFonts["TartineScriptRegular"];
text.contents = alphabet[firstletter] + " " + alphabet[secondletter];
text.position = [2700, 2000];
var filename = alphabet[firstletter] + "+" + alphabet[secondletter] + ".ai";
doc.saveAs(new File("E:/Products/Stencils/TEST/" + filename));
doc.close(SaveOptions.DONOTSAVECHANGES);
};
};
};
ProcessFiles();