Copy link to clipboard
Copied
Hi!
I wrote a script in JavaScript for Adobe Illustrator CC 2017. In this script I am trying to add artboard to the document in function, but it isn't working.
Here code:
function addArtboard() {
var doc = app.documents.add(null,1000,1000);
doc = app.activeDocument;
var artboards = doc.artboards;
artboards.add([0 , 0, 1000, 1000]);
}
addArtboard();
Thanks!
Copy link to clipboard
Copied
change the last element of the parameter in your artboards.add method to -1000. like this:
function addArtboard() {
var doc = app.documents.add(null,1000,1000);
doc = app.activeDocument;
var artboards = doc.artboards;
artboards.add([0 , 0, 1000, -1000]);
}
addArtboard();
Copy link to clipboard
Copied
Hi. In my code artboard is been adding when I write out of function, but when I wrote in a function the artboard isn't adding.
Copy link to clipboard
Copied
can you paste the exact code you're running? I tested this and it worked fine for me.
Copy link to clipboard
Copied
please give me your email
Copy link to clipboard
Copied
You can send me a direct message here on the forum. just click on my username and it will open my profile.
Copy link to clipboard
Copied
The send button doesn't work