概要
vistaでillustratorやってみる。
アートボード作って、文字書いて、png出力してみた。
環境
windows vista
illustrator cs2
写真
サンプルコード
var docRef = documents.add(DocumentColorSpace.RGB, 800, 800);
var textRef1 = docRef.textFrames.add();
textRef1.contents = "Scripting is fun!";
textRef1.top = 700;
textRef1.left = 50;
var textRef2 = docRef.textFrames.add();
textRef2.contents = "Scripting is easy!";
textRef2.top = 625;
textRef2.left = 100;
var textRef3 = docRef.textFrames.add();
textRef3.contents = "Everyone should script!";
textRef3.top = 550;
textRef3.left = 150;
var charStyle = docRef.characterStyles.add("BigRed");
var charAttr = charStyle.characterAttributes;
charAttr.size = 40;
charAttr.tracking = -50;
charAttr.capitalization = FontCapsOption.ALLCAPS;
var redColor = new RGBColor();
redColor.red = 255;
redColor.green = 0;
redColor.blue = 0;
charAttr.fillColor = redColor;
charAttr.textFont = app.textFonts[4]
charStyle.applyTo(textRef1.textRange);
charStyle.applyTo(textRef2.textRange);
charStyle.applyTo(textRef3.textRange);
var pngOpt = new ExportOptionsPNG24();
pngOpt.artBoardClipping = true;
var filePath = new File("/Users/ore/ill0.png");
activeDocument.exportFile(filePath, ExportType.PNG24, pngOpt);
alert("ok");
以上。