Copy link to clipboard
Copied
Hi everyone,
I'm looking for a similar script to adapt it.
I would like to go from -100% on the effect to 0, while rendering each image.
I looked for on google but only found 2004-2005 unuseful scripts.
Thanks in advance,
Loïc
Copy link to clipboard
Copied
check my example code in this thread and change the Deform Style from 9 to 12
Copy link to clipboard
Copied
Copy link to clipboard
Copied
check this thread, ther's a sample that saves each artboard to png, you don't need that but it has a loop and png save sample you can adapt to your needs. Post back if you get stuck.
Copy link to clipboard
Copied
Thanks for your answer, works well. I merged 3 scripts, png export, disort, and duplicate artboard. Here is my script, I cannot figure out why illustrator keep crashing when it begins to draw.
var nbr = 99;
var doc = app.activeDocument;;//Gets the active document
/// SAVE PNG
$.writeln(doc.name);
var fileName = doc.name.slice(0, 9);//Gets the G Number
var numArtboards = doc.artboards.length;//returns the number of artboards in the document
var filePath = (app.activeDocument.fullName.parent.fsName).toString().replace(/\\/g, '/');
var options = new ImageCaptureOptions();
function save() {
for (var i = 0; i < numArtboards; i++) {
doc.artboards.setActiveArtboardIndex(i);
var activeAB = doc.artboards[doc.artboards.getActiveArtboardIndex()];
options.artBoardClipping = true;
options.resolution = 300;
options.antiAliasing = true;
options.matte = false;
options.horizontalScale = 108.3;
options.verticalScale = 108.3;
options.transparency = true;
var artboardName = doc.artboards.name;
var destFile = new File(filePath + "/" + fileName + " " + i + ".png");
doc.imageCapture(destFile, activeAB.artboardRect, options);
}
}
// DRAW
function draw(nbr){
var p = doc.selection[0];
for (index = 0; index < 1; index =+ 1) {
value = index+1 / 100;
xmlstring = '<LiveEffect name="Adobe Deform"><Dict data="B Rotate 0 R DeformVert 0 R DeformHoriz 0 I DeformStyle 12 R DeformValue #value "/></LiveEffect>'.replace('#value', value);
p.applyEffect(xmlstring);
app.redraw();
};
}
function copyartboard(){
var doc = app.activeDocument;
var thisBoardIndex = doc.artboards.getActiveArtboardIndex();
var thisBoard = doc.artboards[thisBoardIndex];
var thisRect = thisBoard.artboardRect;
var lastBoard = doc.artboards[doc.artboards.length - 1];
var lastRect = lastBoard.artboardRect;
doc.selectObjectsOnActiveArtboard();
app.copy();
var newBoard = doc.artboards.add(thisRect);
var offsetH = 0;
//$.writeln(doc.selection[active]);
newBoard.artboardRect = [
lastRect[2] + offsetH,
lastRect[1],
lastRect[2] + offsetH + (thisRect[2] - thisRect[0]),
lastRect[3]
];
newBoard.name = thisBoard.name + " copy";
app.executeMenuCommand("pasteFront");
doc.selection = null;
};
function go(nbr){
for (index = 0; index < nbr ; index++) {
copyartboard();
};
for (active = 0; active < nbr ; active++) {
draw(nbr,active);
};
//save();
}
go(nbr);
Copy link to clipboard
Copied
Copy link to clipboard
Copied