Copy link to clipboard
Copied
jsx guide:
app.documents.add([documentColorSpace] [, width] [, height] [, numArtBoards] [, artboardLayout] [, artboardSpacing] [, artboardRowsOrCols] )
no param to set the unit.
or can I set the unit after the document created? anyone advice?
Copy link to clipboard
Copied
Hi @LoveYou阿逗逼6666, you can make a document preset:
var myDocPreset = new DocumentPreset;
myDocPreset.artboardLayout = DocumentArtboardLayout.GridByRow;
myDocPreset.artboardRowsOrCols = 1;
myDocPreset.artboardSpacing = 20;
myDocPreset.colorMode = DocumentColorSpace.RGB;
myDocPreset.documentBleedLink = true;
myDocPreset.documentBleedOffset = [0, 0, 0, 0];
myDocPreset.height = 5000;
myDocPreset.numArtboards = 1;
myDocPreset.previewMode = DocumentPreviewMode.DefaultPreview;
myDocPreset.rasterResolution = DocumentRasterResolution.ScreenResolution;
myDocPreset.title = 'Test';
myDocPreset.transparencyGrid = DocumentTransparencyGrid.TransparencyGridNone;
myDocPreset.units = RulerUnits.Millimeters;
myDocPreset.width = 5000;
var newDoc = app.documents.addDocument("Basic RGB", myDocPreset);
Just an example, but I've set the RulerUnits to millimeters to show you.
- Mark
Copy link to clipboard
Copied
Also can do this way:
var myDocPreset = app.getPresetSettings('Web');
myDocPreset.width = 960;
myDocPreset.height = 768;
myDocPreset.units = RulerUnits.Millimeters;
var newDoc = app.documents.addDocument(DocumentPresetType.Web, myDocPreset);
- Mark