
Katrina2023
Community Beginner
Katrina2023
Community Beginner
Activity
‎Mar 14, 2022
01:05 PM
1 Upvote
I can rename the pathItems. That would work great. Thank you!
... View more
‎Mar 14, 2022
07:28 AM
That would work for one instance, but I have a variety of artboards that have different angles and scales. Would there be a way to build into the script to know which scale and orientation to apply to a given artboard?
... View more
‎Mar 11, 2022
02:18 PM
I have a script that will apply a pattern swatch to the objects I want, but when I do, it resets any changes I have made to the scale or direction of the pattern. For example, I have a front and back object, the pattern on the front needs to be right side up and the back upside down. Is there a way apply the pattern and retain the orientation that I have previously given the object? Here is what I have: var doc = app.activeDocument; var swatchFrontIndex = doc.swatches.length - 1; var swatchBackIndex = doc.swatches.length - 2; var swatchFront = doc.swatches[swatchFrontIndex].color; var swatchBack = doc.swatches[swatchBackIndex].color; var numbOfLayers = doc.layers.length; var designLayer = doc.layers[numbOfLayers - 1]; var numbOfItems = designLayer.pathItems.length; try{ for(j = 0; j < numbOfItems; j++){ if(designLayer.pathItems[j].name == "Front"){ designLayer.pathItems[j].fillColor = swatchFront; } if(designLayer.pathItems[j].name == "Back"){ designLayer.pathItems[j].fillColor = swatchBack; } } }catch(err) {}
... View more
‎Sep 25, 2020
07:22 AM
That's perfect, thank you!
... View more
‎Sep 24, 2020
03:09 PM
1 Upvote
I have a script that will create an array of all open documents, then it will display each document with a checkbox next to it. I don't know what to do know though. I don't know how to get the script to do something with the checked documents. My goal is to have the checked documents remain open, and the rest get closed without saving. Here is my code so far var docNames = []; for(i = app.documents.length-1; i>-1; i--) { app.documents[app.documents.length-1].activate(); var currentDocName = app.activeDocument.name.replace(".ai",""); docNames.push(currentDocName); } var win = new Window ("dialog{text:'Which files to close?'}"); for(j = 0; j < docNames.length; j++){ win.abc = win.add ("checkbox", undefined, docNames[j]); } win.quitBtn = win.add ("button", undefined, "OK"); win.defaultElement = win.quitBtn; win.show();
... View more
‎Jan 23, 2020
06:50 AM
Sorry, I want to be able to use the revert option using javascript, so I can include it in a script that I have built
... View more
‎Jan 22, 2020
09:27 PM
Hey, I am looking for a way to revert my file to its original state after I run my script. I have been unable to find a way to do this. Is there a function that does this with Javascript? Or is it possible to have illustrator simply close the active document, then reopen it?
... View more
‎Aug 06, 2019
07:55 AM
I am new to javascript and scripting and I'm looking for help to put together a script. I need this script to export multiple artboards to .tiff the the artboard name included in the saved file name. I know there are the properties artboardRange and saveMultipleArtboards, but how do you set it up to get the artboard name to reflect in saved file name? I pulled this code from the adobe scripting reference. function exportFileToPSD (dest) { if ( app.documents.length > 0 ) { var exportOptions = new ExportOptionsTIFF(); var type = ExportType.TIFF; var fileSpec = new File(dest); exportOptions.resolution = 150; exportOptions.byteOrder = TIFFByteOrder.IBMPC; exportOptions.antiAliasing = true; exportOptions.IZWCompression = false; exportOptions.saveMultipleArtboards = true; exportOptions.artboardRange = "1-2,7"; app.activeDocument.exportFile( fileSpec, type, exportOptions ); } }
... View more