Copy link to clipboard
Copied
Here is a function from a script that creates a new document... simple right?
I was expecting the function to generate a new document with 50 artboards with 10 columns? Instead, the number of columns is getting set to whatever value is currently saved in the new document "Columns" property?
Curious if anyone is able to run this code, and set the number of columns by changing the "artboardRowsOrCols" value?
Thanks!
Scott
| Header 1 |
|---|
test(); function test(){ var newDocPresets = new DocumentPreset; newDocPresets.title = "test"; newDocPresets.colorMode = DocumentColorSpace.RGB; newDocPresets.units = RulerUnits.Pixels; newDocPresets.width = 40; newDocPresets.height = 40; newDocPresets.numArtboards = 50; newDocPresets.artboardLayout = DocumentArtboardLayout.GridByRow; newDocPresets.artboardRowsOrCols = 10; // this value is not getting set newDocPresets.artboardSpacing = 30;
var newDoc = app.documents.addDocument( "Basic RGB", newDocPresets ); } |
Hi @scottRaysNI,
one possible way
...test();
function test() {
var newDocPresets = new DocumentPreset;
newDocPresets.title = "test";
newDocPresets.colorMode = DocumentColorSpace.RGB;
newDocPresets.units = RulerUnits.Pixels;
newDocPresets.width = 40;
newDocPresets.height = 40;
newDocPresets.numArtboards = 50;
//newDocPresets.artboardLayout = DocumentArtboardLayout.GridByRow;
//newDocPresets.artboardRowsOrCols = 10; // this value is not getting set
//newDocPrese
Copy link to clipboard
Copied
Hi @scottRaysNI,
one possible way
test();
function test() {
var newDocPresets = new DocumentPreset;
newDocPresets.title = "test";
newDocPresets.colorMode = DocumentColorSpace.RGB;
newDocPresets.units = RulerUnits.Pixels;
newDocPresets.width = 40;
newDocPresets.height = 40;
newDocPresets.numArtboards = 50;
//newDocPresets.artboardLayout = DocumentArtboardLayout.GridByRow;
//newDocPresets.artboardRowsOrCols = 10; // this value is not getting set
//newDocPresets.artboardSpacing = 30;
var newDoc = app.documents.addDocument( "Basic RGB", newDocPresets );
newDoc.rearrangeArtboards(DocumentArtboardLayout.GridByRow , 10 , 30 , true);
}
Have fun
![]()
Copy link to clipboard
Copied
This morning I remembered the "Rearrange" UI command, and was unsure if that was accessible through script. I guess it is! ![]()
This worked, thanks!
scott
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more