yes, full code is below. var omf = 2.834645; var x=0; var y=0; var verschuivingx = 0; var verschuivingy = 0; var size= 0; docPreset = new DocumentPreset; docPreset.width = 100*omf; docPreset.colorMode = DocumentColorSpace.CMYK docPreset.previewMode = DocumentPreviewMode.OverprintPreview; docPreset.rasterResolution = DocumentRasterResolution.HighResolution; docPreset.title = "testgradient"; docPreset.rulerUnits = RulerUnits.Millimeters; docPreset.height = (100*omf); docPreset.name = "testgradient"; var doc = app.documents.addDocument(DocumentColorSpace.CMYK,docPreset); app.activeDocument.layers[0].name = "testgradient"; var line = doc.pathItems.add(); line.setEntirePath(Array(Array(((x+167.922261870534+verschuivingx)*omf ),((y+99.0916493732019+size - verschuivingy)*omf)), Array(((x+39.8638983011982+verschuivingx)*omf),( (y+99.0916493732019+size - verschuivingy)*omf)),Array(((x+39.8638983011982+verschuivingx)*omf), ( (y+215.861121388216+size - verschuivingy)*omf)),Array(((x+167.922261870534+verschuivingx)*omf),( (y+215.861121388216+size - verschuivingy)*omf)))); line.pathPoints[0].leftDirection = Array(((x+167.922261870534+verschuivingx)*omf),((y+99.0916493732019-verschuivingy)*omf)); line.pathPoints[0].rightDirection = Array(((x+167.922261870534+verschuivingx)*omf),((y+99.0916493732019-verschuivingy)*omf)); line.pathPoints[1].leftDirection = Array(((x+39.8638983011982+verschuivingx)*omf),((y+99.0916493732019-verschuivingy)*omf)); line.pathPoints[1].rightDirection = Array(((x+39.8638983011982+verschuivingx)*omf),((y+99.0916493732019-verschuivingy)*omf)); line.pathPoints[2].leftDirection = Array(((x+39.8638983011982+verschuivingx)*omf),((y+215.861121388216-verschuivingy)*omf)); line.pathPoints[2].rightDirection = Array(((x+39.8638983011982+verschuivingx)*omf),((y+215.861121388216-verschuivingy)*omf)); line.pathPoints[3].leftDirection = Array(((x+167.922261870534+verschuivingx)*omf),((y+215.861121388216-verschuivingy)*omf)); line.pathPoints[3].rightDirection = Array(((x+167.922261870534+verschuivingx)*omf),((y+215.861121388216-verschuivingy)*omf)); line.closed = true; line.stroked= false; line.filled= true; var newGradient = app.activeDocument.gradients.add(); newGradient.name = "NewGradient0"; newGradient.type=GradientType.LINEAR; var itemColor1 = new CMYKColor(); itemColor1.cyan = 0; itemColor1.magenta = 100; itemColor1.yellow = 100; itemColor1.black = 0; newGradient.gradientStops[1].color = itemColor1; newGradient.gradientStops[1].rampPoint=100; newGradient.gradientStops[1].midPoint=50; var itemColor0 = new CMYKColor(); itemColor0.cyan = 0; itemColor0.magenta = 0; itemColor0.yellow = 100; itemColor0.black = 0; newGradient.gradientStops[0].color = itemColor0; newGradient.gradientStops[0].rampPoint=0; newGradient.gradientStops[0].midPoint=50; var colorOfGradient = new GradientColor(); colorOfGradient.gradient = newGradient; line.fillColor = colorOfGradient; line.fillOverprint = false; line.rotate(130,false,false,true,false); var itemColor = new Array(); itemColor[2] = new CMYKColor(); itemColor[2].cyan = 0; itemColor[2].magenta = 75; itemColor[2].yellow = 100; itemColor[2].black = 0; itemColor[1] = new CMYKColor(); itemColor[1].cyan = 30; itemColor[1].magenta = 100; itemColor[1].yellow = 0; itemColor[1].black = 0; itemColor[0] = new CMYKColor(); itemColor[0].cyan = 85; itemColor[0].magenta = 10; itemColor[0].yellow = 100; itemColor[0].black = 0; for (i=0;i<itemColor.length;i++){ grdntstop= doc.gradients.getByName("NewGradient0").gradientStops.add(); grdntstop.color = itemColor; grdntstop.rampPoint = (i+1)/(itemColor.length+1)*100; grdntstop.midPoint=50; } var illustratorversion = app.version; var illustratorversionarray = illustratorversion.split("."); if(illustratorversionarray[0]>13){ app.activeDocument.artboards[0].artboardRect = app.activeDocument.visibleBounds; } zet_nulpunt(); zoomcenterpage() function zoomcenterpage(){ var myView=app.activeDocument.views[0]; myView.centerPoint = [(app.activeDocument.width/2),(app.activeDocument.height/2)]; myView.zoom = 1 myView.screenMode.FULLSCREEN; } function zet_nulpunt(){ // zet nulpunt linksonder app.activeDocument.pageOrigin = Array(0,0); app.activeDocument.rulerOrigin = Array(0,0); } result images...
... View more