// SPIRALĀ© 2010 // Made by: Daniel van Willigen // Last update 04-12-10 // Define variables var omf = 2.834645; var presscancelbutton = 0; var creativeline = 0; //Run menu menuinterface(); if (presscancelbutton >= 0) { // Create new document with layer docPreset = new DocumentPreset; docPreset.width = 100*omf; docPreset.colorMode = DocumentColorSpace.CMYK docPreset.previewMode = DocumentPreviewMode.OverprintPreview; docPreset.rasterResolution = DocumentRasterResolution.HighResolution; docPreset.title = 'Spiral'; docPreset.rulerUnits = RulerUnits.Millimeters; docPreset.height = (100*omf); docPreset.name = 'Spiral'; var doc = app.documents.addDocument(DocumentColorSpace.CMYK,docPreset); app.activeDocument.layers[0].name = 'Spiral'; var rotation = new Number (win.menugroup.rotationgroup.rotategroup.et.text); if(win.menugroup.shapegroup.ddl.selection == 0){ try{ var spiralheight = new Number (win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.et.text); var spiralwidth = new Number (win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.et.text); //rectangle for (var i=0 ; i < 360; i++) { var rect = app.activeDocument.layers['Spiral'].pathItems.rectangle(spiralheight*omf,0*omf,spiralwidth*omf,spiralheight*omf) rect.filled= false; rect.stroked = true; if(win.menugroup.linesgroup.randomwidth.value==false){ var linewidthspiral = new Number (win.menugroup.linesgroup.widthgroup.et.text); }else if(win.menugroup.linesgroup.randomwidth.value==true){ var linewidthspiral = Math.random(); } rect.strokeWidth = linewidthspiral*omf; // Define color if(win.menugroup.colorgroup.randomcolor.value==false){ var newSpot = doc.spots.add(); var lineColor = new CMYKColor(); lineColor.cyan = win.menugroup.colorgroup.cyangroup.et.text; lineColor.magenta = win.menugroup.colorgroup.magentagroup.et.text; lineColor.yellow = win.menugroup.colorgroup.yellowgroup.et.text; lineColor.black = win.menugroup.colorgroup.blackgroup.et.text; newSpot.name = 'lineColor'+i; newSpot.colorType = ColorModel.PROCESS; newSpot.color = lineColor; var newSpotColor = new SpotColor(); newSpotColor.spot = newSpot; }else if(win.menugroup.colorgroup.randomcolor.value==true){ var newSpot = doc.spots.add(); var lineColor = new CMYKColor(); lineColor.cyan = Math.random()*100; lineColor.magenta = Math.random()*100; lineColor.yellow = Math.random()*100; lineColor.black = Math.random()*100; newSpot.name = 'lineColor'+i; newSpot.colorType = ColorModel.PROCESS; newSpot.color = lineColor; var newSpotColor = new SpotColor(); newSpotColor.spot = newSpot; } rect.strokeColor = doc.swatches['lineColor'+i].color; // Set tint if(win.menugroup.percentagegroup.randomtint.value==false){ var newtint = win.menugroup.percentagegroup.tintgroup.et.text; }else if(win.menugroup.percentagegroup.randomtint.value==true){ var newtint = Math.random()*100; } rect.strokeColor.tint = newtint; rect.rotate(i,true,false,false,false,Transformation.TOP); i = i + rotation; } } catch (e) { } } if(win.menugroup.shapegroup.ddl.selection == 1){ try{ var spiralheight = new Number (win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.et.text); var spiralwidth = new Number (win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.et.text); // Ellipse for (var i=0 ; i < 360; i++) { var ellipse = app.activeDocument.layers['Spiral'].pathItems.ellipse(spiralheight*omf,0*omf,spiralwidth*omf,spiralheight*omf,false,true) ellipse.filled= false; ellipse.stroked = true; if(win.menugroup.linesgroup.randomwidth.value==false){ var linewidthspiral = new Number (win.menugroup.linesgroup.widthgroup.et.text); }else if(win.menugroup.linesgroup.randomwidth.value==true){ var linewidthspiral = Math.random(); } ellipse.strokeWidth = linewidthspiral*omf; // Define color if(win.menugroup.colorgroup.randomcolor.value==false){ var newSpot = doc.spots.add(); var lineColor = new CMYKColor(); lineColor.cyan = win.menugroup.colorgroup.cyangroup.et.text; lineColor.magenta = win.menugroup.colorgroup.magentagroup.et.text; lineColor.yellow = win.menugroup.colorgroup.yellowgroup.et.text; lineColor.black = win.menugroup.colorgroup.blackgroup.et.text; newSpot.name = 'lineColor'+i; newSpot.colorType = ColorModel.PROCESS; newSpot.color = lineColor; var newSpotColor = new SpotColor(); newSpotColor.spot = newSpot; }else if(win.menugroup.colorgroup.randomcolor.value==true){ var newSpot = doc.spots.add(); var lineColor = new CMYKColor(); lineColor.cyan = Math.random()*100; lineColor.magenta = Math.random()*100; lineColor.yellow = Math.random()*100; lineColor.black = Math.random()*100; newSpot.name = 'lineColor'+i; newSpot.colorType = ColorModel.PROCESS; newSpot.color = lineColor; var newSpotColor = new SpotColor(); newSpotColor.spot = newSpot; } ellipse.strokeColor = doc.swatches['lineColor'+i].color; // Set tint if(win.menugroup.percentagegroup.randomtint.value==false){ var newtint = win.menugroup.percentagegroup.tintgroup.et.text; }else if(win.menugroup.percentagegroup.randomtint.value==true){ var newtint = Math.random()*100; } ellipse.strokeColor.tint = newtint; ellipse.rotate(i,true,false,false,false,Transformation.TOP); i = i + rotation; } } catch (e) { } } if(win.menugroup.shapegroup.ddl.selection == 2){ try{ var spiralheight = new Number (win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.et.text); var spiralwidth = new Number (win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.et.text); //polygon for (var i=0 ; i < 360; i++) { var octagon = app.activeDocument.layers['Spiral'].pathItems.polygon(((spiralheight/2)*omf), ((spiralwidth/2)*omf), ((spiralwidth/2)*omf), win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.et.text) octagon.filled= false; octagon.stroked = true; if(win.menugroup.linesgroup.randomwidth.value==false){ var linewidthspiral = new Number (win.menugroup.linesgroup.widthgroup.et.text); }else if(win.menugroup.linesgroup.randomwidth.value==true){ var linewidthspiral = Math.random(); } octagon.strokeWidth = linewidthspiral*omf; // Define color if(win.menugroup.colorgroup.randomcolor.value==false){ var newSpot = doc.spots.add(); var lineColor = new CMYKColor(); lineColor.cyan = win.menugroup.colorgroup.cyangroup.et.text; lineColor.magenta = win.menugroup.colorgroup.magentagroup.et.text; lineColor.yellow = win.menugroup.colorgroup.yellowgroup.et.text; lineColor.black = win.menugroup.colorgroup.blackgroup.et.text; newSpot.name = 'lineColor'+i; newSpot.colorType = ColorModel.PROCESS; newSpot.color = lineColor; var newSpotColor = new SpotColor(); newSpotColor.spot = newSpot; }else if(win.menugroup.colorgroup.randomcolor.value==true){ var newSpot = doc.spots.add(); var lineColor = new CMYKColor(); lineColor.cyan = Math.random()*100; lineColor.magenta = Math.random()*100; lineColor.yellow = Math.random()*100; lineColor.black = Math.random()*100; newSpot.name = 'lineColor'+i; newSpot.colorType = ColorModel.PROCESS; newSpot.color = lineColor; var newSpotColor = new SpotColor(); newSpotColor.spot = newSpot; } octagon.strokeColor = doc.swatches['lineColor'+i].color; // Set tint if(win.menugroup.percentagegroup.randomtint.value==false){ var newtint = win.menugroup.percentagegroup.tintgroup.et.text; }else if(win.menugroup.percentagegroup.randomtint.value==true){ var newtint = Math.random()*100; } octagon.strokeColor.tint = newtint; octagon.rotate(i,true,false,false,false,Transformation.TOP); i = i + rotation; } } catch (e) { } } if(win.menugroup.shapegroup.ddl.selection == 3){ try{ var spiralheight = new Number (win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.et.text); var spiralwidth = new Number (win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.et.text); // Star for (var i=0 ; i < 360; i++) { var star = app.activeDocument.layers['Spiral'].pathItems.star(((spiralheight/2)*omf),((spiralwidth/2)*omf),((spiralwidth/2)*omf),(((spiralwidth/2)/2)*omf),win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.et.text) star.filled= false; star.stroked = true; if(win.menugroup.linesgroup.randomwidth.value==false){ var linewidthspiral = new Number (win.menugroup.linesgroup.widthgroup.et.text); }else if(win.menugroup.linesgroup.randomwidth.value==true){ var linewidthspiral = Math.random(); } star.strokeWidth = linewidthspiral*omf; // Define color if(win.menugroup.colorgroup.randomcolor.value==false){ var newSpot = doc.spots.add(); var lineColor = new CMYKColor(); lineColor.cyan = win.menugroup.colorgroup.cyangroup.et.text; lineColor.magenta = win.menugroup.colorgroup.magentagroup.et.text; lineColor.yellow = win.menugroup.colorgroup.yellowgroup.et.text; lineColor.black = win.menugroup.colorgroup.blackgroup.et.text; newSpot.name = 'lineColor'+i; newSpot.colorType = ColorModel.PROCESS; newSpot.color = lineColor; var newSpotColor = new SpotColor(); newSpotColor.spot = newSpot; }else if(win.menugroup.colorgroup.randomcolor.value==true){ var newSpot = doc.spots.add(); var lineColor = new CMYKColor(); lineColor.cyan = Math.random()*100; lineColor.magenta = Math.random()*100; lineColor.yellow = Math.random()*100; lineColor.black = Math.random()*100; newSpot.name = 'lineColor'+i; newSpot.colorType = ColorModel.PROCESS; newSpot.color = lineColor; var newSpotColor = new SpotColor(); newSpotColor.spot = newSpot; } star.strokeColor = doc.swatches['lineColor'+i].color; // Set tint if(win.menugroup.percentagegroup.randomtint.value==false){ var newtint = win.menugroup.percentagegroup.tintgroup.et.text; }else if(win.menugroup.percentagegroup.randomtint.value==true){ var newtint = Math.random()*100; } star.strokeColor.tint = newtint; star.rotate(i,true,false,false,false,Transformation.TOP); i = i + rotation; } } catch (e) { } } var illustratorversion = app.version; var illustratorversionarray = illustratorversion.split('.'); if(illustratorversionarray[0]>13){ app.activeDocument.artboards[0].artboardRect = app.activeDocument.visibleBounds; } zet_nulpunt(); zoomcenterpage(); } function menuinterface(){ #targetengine illustrator res = "dialog { \ text:'Spiral', \ properties:{ closeOnKey:'OSCmnd+W', resizeable:false}, \ ddl: DropDownList { alignment:'left', preferredSize: [260, 20] }, \ menugroup: Panel { orientation:'stack', preferredSize: [200, 20], alignChildren:'top', text: 'Shape', \ shapegroup: Group { orientation:'column', preferredSize: [200, 20], alignChildren:'top', \ ddl: DropDownList { alignment:'left', preferredSize: [225, 20] }, \ optiongroup: Group { orientation:'stack', preferredSize: [200, 20], alignChildren:'top', \ rectanglegroup: Group { orientation:'column', preferredSize: [200, 20], alignChildren:'top', \ widthgroup: Group { alignment:'left',\ st: StaticText { text:'Width :' }, \ sl: Slider { minvalue:1, maxvalue:1000, value:60 }, \ et: EditText { characters:4, justify:'right', text:'60' } \ } \ heightgroup: Group { alignment:'left',\ st: StaticText { text:'Height :' }, \ sl: Slider { minvalue:1, maxvalue:1000, value:60 }, \ et: EditText { characters:4, justify:'right', text:'60' } \ } \ } \ ellipsegroup: Group { orientation:'column', preferredSize: [200, 20], alignChildren:'top', \ widthgroup: Group { alignment:'left',\ st: StaticText { text:'Width :' }, \ sl: Slider { minvalue:1, maxvalue:1000, value:60 }, \ et: EditText { characters:4, justify:'right', text:'60' } \ } \ heightgroup: Group { alignment:'left',\ st: StaticText { text:'Height :' }, \ sl: Slider { minvalue:1, maxvalue:1000, value:60 }, \ et: EditText { characters:4, justify:'right', text:'60' } \ } \ } \ polygongroup: Group { orientation:'column', preferredSize: [200, 20], alignChildren:'top', \ widthgroup: Group { alignment:'left',\ st: StaticText { text:'Width :' }, \ sl: Slider { minvalue:1, maxvalue:1000, value:60 }, \ et: EditText { characters:4, justify:'right', text:'60' } \ } \ heightgroup: Group { alignment:'left',\ st: StaticText { text:'Height :' }, \ sl: Slider { minvalue:1, maxvalue:1000, value:60 }, \ et: EditText { characters:4, justify:'right', text:'60' } \ } \ pointsgroup: Group { alignment:'left',\ st: StaticText { text:'Points :' }, \ sl: Slider { minvalue:3, maxvalue:30, value:5 }, \ et: EditText { characters:4, justify:'right', text:'5' } \ } \ } \ stargroup: Group { orientation:'column', preferredSize: [200, 20], alignChildren:'top', \ widthgroup: Group { alignment:'left',\ st: StaticText { text:'Width :' }, \ sl: Slider { minvalue:1, maxvalue:1000, value:60 }, \ et: EditText { characters:4, justify:'right', text:'60' } \ } \ heightgroup: Group { alignment:'left',\ st: StaticText { text:'Height :' }, \ sl: Slider { minvalue:1, maxvalue:1000, value:60 }, \ et: EditText { characters:4, justify:'right', text:'60' } \ } \ pointsgroup: Group { alignment:'left',\ st: StaticText { text:'Points :' }, \ sl: Slider { minvalue:3, maxvalue:30, value:30 }, \ et: EditText { characters:4, justify:'right', text:'30' } \ } \ } \ } \ } \ colorgroup: Group { orientation:'column', preferredSize: [200, 20], alignChildren:'top', \ cyangroup: Group { alignment:'left',\ st: StaticText { text:'Cyan :' }, \ sl: Slider { minvalue:0, maxvalue:100, value:0 }, \ et: EditText { characters:4, justify:'right', text:'0' } \ } \ magentagroup: Group { alignment:'left',\ st: StaticText { text:'Magenta:' }, \ sl: Slider { minvalue:0, maxvalue:100, value:100 }, \ et: EditText { characters:4, justify:'right', text:'100' } \ } \ yellowgroup: Group { alignment:'left',\ st: StaticText { text:'Yellow :' }, \ sl: Slider { minvalue:0, maxvalue:100, value:100 }, \ et: EditText { characters:4, justify:'right', text:'100' } \ } \ blackgroup: Group { alignment:'left',\ st: StaticText { text:'Black :' }, \ sl: Slider { minvalue:0, maxvalue:100, value:0 }, \ et: EditText { characters:4, justify:'right', text:'0' } \ } \ randomcolor: Checkbox { \ alignment:'left', text:'Set color to random', value:false \ }, \ }, \ percentagegroup: Group { orientation:'column', preferredSize: [200, 20], alignChildren:'top', \ tintgroup: Group { alignment:'left',\ st: StaticText { text:'Tint :' }, \ sl: Slider { minvalue:0, maxvalue:100, value:100 }, \ et: EditText { characters:4, justify:'right', text:'100' } \ } \ randomtint: Checkbox { \ alignment:'left', text:'Set tint to random', value:true \ }, \ }, \ linesgroup: Group { orientation:'column', preferredSize: [200, 20], alignChildren:'top', \ widthgroup: Group { alignment:'left',\ st: StaticText { text:'Width :' }, \ sl: Slider { minvalue:0.1, maxvalue:100, value:0.3 }, \ et: EditText { characters:4, justify:'right', text:'0.3' } \ } \ randomwidth: Checkbox { \ alignment:'left', text:'Set line width to random', value:true \ }, \ }, \ rotationgroup: Group { orientation:'column', preferredSize: [200, 20], alignChildren:'top', \ rotategroup: Group { alignment:'left',\ st: StaticText { text:'Rotate :' }, \ sl: Slider { minvalue:1, maxvalue:180, value:5 }, \ et: EditText { characters:4, justify:'right', text:'5' } \ } \ }, \ } \ buttons: Group { orientation: 'row', alignment: 'center', \ cancelBtn: Button { text:'Cancel', properties:{name:'cancel'} }, \ doneBtn: Button { text:'Ok', properties:{name:'ok'} }, \ } \ }"; win = new Window (res); win.frameLocation = [100, 100]; win.menugroup.percentagegroup.tintgroup.enabled = false; win.menugroup.linesgroup.widthgroup.enabled = false; // set dropdownlist win.ddl.onChange = function () { if (this.selection != null) { for (var g = 0; g < this.items.length; g++) this.items[g].group.visible = false; this.selection.group.visible = true; } if (win.ddl.selection == 0){win.menugroup.text = 'Shape';} if (win.ddl.selection == 1){win.menugroup.text = 'Color';} if (win.ddl.selection == 2){win.menugroup.text = 'Tint';} if (win.ddl.selection == 3){win.menugroup.text = 'Lines';} if (win.ddl.selection == 4){win.menugroup.text = 'Rotate';} } var item = win.ddl.add ('item', 'Shape'); item.group = win.menugroup.shapegroup; item = win.ddl.add ('item', 'Color'); item.group = win.menugroup.colorgroup; item = win.ddl.add ('item', 'Tint'); item.group = win.menugroup.percentagegroup; item = win.ddl.add ('item', 'Lines'); item.group = win.menugroup.linesgroup; item = win.ddl.add ('item', 'Rotate'); item.group = win.menugroup.rotationgroup; win.ddl.selection = win.ddl.items[0]; // set dropdownlist win.menugroup.shapegroup.ddl.onChange = function () { if (this.selection != null) { for (var g = 0; g < this.items.length; g++) this.items[g].group.visible = false; this.selection.group.visible = true; } } var item = win.menugroup.shapegroup.ddl.add ('item', 'Rectangle'); item.group = win.menugroup.shapegroup.optiongroup.rectanglegroup; item = win.menugroup.shapegroup.ddl.add ('item', 'Ellipse'); item.group = win.menugroup.shapegroup.optiongroup.ellipsegroup; item = win.menugroup.shapegroup.ddl.add ('item', 'Polygon'); item.group = win.menugroup.shapegroup.optiongroup.polygongroup; item = win.menugroup.shapegroup.ddl.add ('item', 'Star'); item.group = win.menugroup.shapegroup.optiongroup.stargroup; win.menugroup.shapegroup.ddl.selection = win.menugroup.shapegroup.ddl.items[3]; // set color checkbox win.menugroup.colorgroup.randomcolor.onClick = function () { if (win.menugroup.colorgroup.randomcolor.value==true){ win.menugroup.colorgroup.cyangroup.enabled = false; win.menugroup.colorgroup.magentagroup.enabled = false; win.menugroup.colorgroup.yellowgroup.enabled = false; win.menugroup.colorgroup.blackgroup.enabled = false; }; if (win.menugroup.colorgroup.randomcolor.value==false){ win.menugroup.colorgroup.cyangroup.enabled = true; win.menugroup.colorgroup.magentagroup.enabled = true; win.menugroup.colorgroup.yellowgroup.enabled = true; win.menugroup.colorgroup.blackgroup.enabled = true; }; } // set lines width checkbox win.menugroup.linesgroup.randomwidth.onClick = function () { if (win.menugroup.linesgroup.randomwidth.value==true){ win.menugroup.linesgroup.widthgroup.enabled = false; }; if (win.menugroup.linesgroup.randomwidth.value==false){ win.menugroup.linesgroup.widthgroup.enabled = true; }; } // set tint checkbox win.menugroup.percentagegroup.randomtint.onClick = function () { if (win.menugroup.percentagegroup.randomtint.value==true){ win.menugroup.percentagegroup.tintgroup.enabled = false; }; if (win.menugroup.percentagegroup.randomtint.value==false){ win.menugroup.percentagegroup.tintgroup.enabled = true; }; } // tint sliders win.menugroup.percentagegroup.tintgroup.sl.onChange = function () { win.menugroup.percentagegroup.tintgroup.et.text = Math.round(win.menugroup.percentagegroup.tintgroup.sl.value); } win.menugroup.percentagegroup.tintgroup.et.onChange = function () { if (win.menugroup.percentagegroup.tintgroup.et.text > 100){win.menugroup.percentagegroup.tintgroup.et.text = 100} if (win.menugroup.percentagegroup.tintgroup.et.text < 0){win.menugroup.percentagegroup.tintgroup.et.text = 0} win.menugroup.percentagegroup.tintgroup.sl.value= win.menugroup.percentagegroup.tintgroup.et.text } // color sliders win.menugroup.colorgroup.cyangroup.sl.onChange = function () { win.menugroup.colorgroup.cyangroup.et.text = Math.round(win.menugroup.colorgroup.cyangroup.sl.value); } win.menugroup.colorgroup.magentagroup.sl.onChange = function () { win.menugroup.colorgroup.magentagroup.et.text = Math.round(win.menugroup.colorgroup.magentagroup.sl.value); } win.menugroup.colorgroup.yellowgroup.sl.onChange = function () { win.menugroup.colorgroup.yellowgroup.et.text = Math.round(win.menugroup.colorgroup.yellowgroup.sl.value); } win.menugroup.colorgroup.blackgroup.sl.onChange = function () { win.menugroup.colorgroup.blackgroup.et.text = Math.round(win.menugroup.colorgroup.blackgroup.sl.value); } win.menugroup.colorgroup.cyangroup.et.onChange = function () { if (win.menugroup.colorgroup.cyangroup.et.text > 100){win.menugroup.colorgroup.cyangroup.et.text = 100} if (win.menugroup.colorgroup.cyangroup.et.text < 0){win.menugroup.colorgroup.cyangroup.et.text = 0} win.menugroup.colorgroup.cyangroup.sl.value= win.menugroup.colorgroup.cyangroup.et.text } win.menugroup.colorgroup.magentagroup.et.onChange = function () { if (win.menugroup.colorgroup.magentagroup.et.text > 100){win.menugroup.colorgroup.magentagroup.et.text = 100} if (win.menugroup.colorgroup.magentagroup.et.text < 0){win.menugroup.colorgroup.magentagroup.et.text = 0} win.menugroup.colorgroup.magentagroup.sl.value= win.menugroup.colorgroup.magentagroup.et.text } win.menugroup.colorgroup.yellowgroup.et.onChange = function () { if (win.menugroup.colorgroup.yellowgroup.et.text > 100){win.menugroup.colorgroup.yellowgroup.et.text = 100} if (win.menugroup.colorgroup.yellowgroup.et.text < 0){win.menugroup.colorgroup.yellowgroup.et.text = 0} win.menugroup.colorgroup.yellowgroup.sl.value= win.menugroup.colorgroup.yellowgroup.et.text } win.menugroup.colorgroup.blackgroup.et.onChange = function () { if (win.menugroup.colorgroup.blackgroup.et.text > 100){win.menugroup.colorgroup.blackgroup.et.text = 100} if (win.menugroup.colorgroup.blackgroup.et.text < 0){win.menugroup.colorgroup.blackgroup.et.text = 0} win.menugroup.colorgroup.blackgroup.sl.value= win.menugroup.colorgroup.blackgroup.et.text } // line sliders win.menugroup.linesgroup.widthgroup.sl.onChange = function () { win.menugroup.linesgroup.widthgroup.et.text = win.menugroup.linesgroup.widthgroup.sl.value; } win.menugroup.linesgroup.widthgroup.et.onChange = function () { if (win.menugroup.linesgroup.widthgroup.et.text > 100){win.menugroup.linesgroup.widthgroup.et.text = 100} if (win.menugroup.linesgroup.widthgroup.et.text < 0.1){win.menugroup.linesgroup.widthgroup.et.text = 0.1} win.menugroup.linesgroup.widthgroup.sl.value= win.menugroup.linesgroup.widthgroup.et.text } // rotate sliders win.menugroup.rotationgroup.rotategroup.sl.onChange = function () { win.menugroup.rotationgroup.rotategroup.et.text = Math.round(win.menugroup.rotationgroup.rotategroup.sl.value); } win.menugroup.rotationgroup.rotategroup.et.onChange = function () { if (win.menugroup.rotationgroup.rotategroup.et.text > 180){win.menugroup.rotationgroup.rotategroup.et.text = 180} if (win.menugroup.rotationgroup.rotategroup.et.text < 1){win.menugroup.rotationgroup.rotategroup.et.text = 1} win.menugroup.rotationgroup.rotategroup.sl.value= win.menugroup.rotationgroup.rotategroup.et.text } // rectangle sliders win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.et.text = win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.sl.value; } win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.et.text > 1000){win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.et.text = 1000} if (win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.et.text < 1){win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.et.text = 1} win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.sl.value= win.menugroup.shapegroup.optiongroup.rectanglegroup.widthgroup.et.text } win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.et.text = win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.sl.value; } win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.et.text > 1000){win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.et.text = 1000} if (win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.et.text < 1){win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.et.text = 1} win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.sl.value= win.menugroup.shapegroup.optiongroup.rectanglegroup.heightgroup.et.text } // ellipse sliders win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.et.text = win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.sl.value; } win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.et.text > 1000){win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.et.text = 1000} if (win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.et.text < 1){win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.et.text = 1} win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.sl.value= win.menugroup.shapegroup.optiongroup.ellipsegroup.widthgroup.et.text } win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.et.text = win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.sl.value; } win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.et.text > 1000){win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.et.text = 1000} if (win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.et.text < 1){win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.et.text = 1} win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.sl.value= win.menugroup.shapegroup.optiongroup.ellipsegroup.heightgroup.et.text } // polygon sliders win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.et.text = win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.sl.value; } win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.et.text > 1000){win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.et.text = 1000} if (win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.et.text < 1){win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.et.text = 1} win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.sl.value= win.menugroup.shapegroup.optiongroup.polygongroup.widthgroup.et.text } win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.et.text = win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.sl.value; } win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.et.text > 1000){win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.et.text = 1000} if (win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.et.text < 1){win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.et.text = 1} win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.sl.value= win.menugroup.shapegroup.optiongroup.polygongroup.heightgroup.et.text } win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.et.text = Math.round(win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.sl.value); } win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.et.text > 30){win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.et.text = 30} if (win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.et.text < 3){win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.et.text = 3} win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.sl.value= win.menugroup.shapegroup.optiongroup.polygongroup.pointsgroup.et.text } // star sliders win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.et.text = win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.sl.value; } win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.et.text > 1000){win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.et.text = 1000} if (win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.et.text < 1){win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.et.text = 1} win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.sl.value= win.menugroup.shapegroup.optiongroup.stargroup.widthgroup.et.text } win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.et.text = win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.sl.value; } win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.et.text > 1000){win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.et.text = 1000} if (win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.et.text < 1){win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.et.text = 1} win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.sl.value= win.menugroup.shapegroup.optiongroup.stargroup.heightgroup.et.text } win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.sl.onChange = function () { win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.et.text = Math.round(win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.sl.value); } win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.et.onChange = function () { if (win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.et.text > 30){win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.et.text = 30} if (win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.et.text < 3){win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.et.text = 3} win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.sl.value= win.menugroup.shapegroup.optiongroup.stargroup.pointsgroup.et.text } // add button win.buttons.cancelBtn.onClick = function () { presscancelbutton = presscancelbutton - 1; wininfo.close(); }; win.buttons.doneBtn.onClick = function () { win.close(); }; win.center(); win.show(); }; 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); }