Hi All,
i need to create custom trianlge with angle inputs example (30º ,45º, 60º). In the below script links i could find only 2 angles and 1side as input.
Custom Angled Triangles Question
Any updates.
regards,
Vinoth
Hi All,
i need to create custom trianlge with angle inputs example (30º ,45º, 60º). In the below script links i could find only 2 angles and 1side as input.
Custom Angled Triangles Question
Any updates.
regards,
Vinoth
Hello there,
I'm modifying a javascript that makes an export of each layer contained in an Illustrator document and I want to specify the method used for anti-aliasing (either Type Optimized or Art Optimized). Similarly to the option under the "Image size" tab in the "Save for the Web" panel.
I didn't find any antiAliasingMethod property in the ExportOptionsPNG24 properties (only an antiAliasing property that accepts boolean). So I wonder if it is actually possible to do it through scripting?
Many thanks,
D
Hi,
I wrote an application in VB.NET. This application is using Illustrator to import a drawing in DWG format. Then I change some colors and lines in different layers. Everything works fine! But it is very slow!
I use VB.NET language. For a test I wrote a small program to compare VB.NET with JavaScript. JavaScript is much faster!
VB.NET: 60 seconds
JavaScript: 5 secondes
Is there any solution to make my application faster?
Thumbnails in layers panel are removed.
Is it possible to switch off all screen refreshes in Illustrator?
Harald
Hi All,
I want get drop shadow of the path item in javascript.
is it possible ?
Regards
Ashish.
First of all thanks in advance for anyone who may assist, or make this even possible...... (please contanct me ADAM razo.ad1985 --->G.mail)
In dire need of expertise assistante. Years ago I DLded this script and got this working and older illustrator. NOW i have Illustrator CS6. I would love/like to TYpe text on a spiral path, then have the abitly for "user input(entering custom values)" as far as
Font Start Size/Pt = 80
Font End Size/Pt = 12
Just a concept......(maybe someone can do this)
Then have illustrator(script) perform action and make my spiral big(80pt) at beggning of text and end at small(12pt) there for looking as FONT/TEXT Gradually shrinks in size from beggining(80pt) unitl end of font/text(12pt)
similar to this(end result after srcipt ran and values entered)
I know there is an older script out there..... but if someone can perhaps undate this and modernize it with prompt for user input/customization interaction
ChangeSizesOfTextSelection.js -----> http://forums.adobe.com/thread/447657
I have made this little script to quickly add margins to an illustrator document and am posting it here to anyone that might find this helpful.
The script will bring up a dialog where you can enter the sizes. Checking the equal box makes all sizes the same as the first.
You have the option of using Millimetres, Inches or Pixels for your units and a last option to apply to all artboards or just the active one.
The script then adds the guides to a locked layer called 'Margins' for convenience.
There are two versions for your taste- The first creates 4 seperate guidelines. The second creates one rectangle guide.
#target illustrator
var docRef = app.activeDocument;
var artboardRef = docRef.artboards;
var workingLayer = docRef.activeLayer;
//window
var win = new Window('dialog', "Add Margins");
this.windowRef = win;
//panels
win.fieldpanel = win.add("panel", undefined, "");
win.radiopanel = win.add("panel", undefined, "");
win.radiopanel2 = win.add("panel", undefined, "");
//panel orientation
win.fieldpanel.orientation='row';
win.radiopanel.orientation='row';
win.radiopanel2.orientation='row';
//fieldpanel
win.fieldpanel.panel1 = win.fieldpanel.add('panel', undefined, "Left");
win.fieldpanel.panel2 = win.fieldpanel.add('panel', undefined, "Right");
win.fieldpanel.panel3 = win.fieldpanel.add('panel', undefined, "Top");
win.fieldpanel.panel4 = win.fieldpanel.add('panel', undefined, "Bottom");
win.fieldpanel.panel1.left_input = win.fieldpanel.panel1.add('edittext', undefined, "0");
win.fieldpanel.panel2.right_input = win.fieldpanel.panel2.add('edittext', undefined, "0");
win.fieldpanel.panel3.top_input = win.fieldpanel.panel3.add('edittext', undefined, "0");
win.fieldpanel.panel4.bottom_input = win.fieldpanel.panel4.add('edittext', undefined, "0");
win.fieldpanel.panel1.left_input.characters = 5;
win.fieldpanel.panel2.right_input.characters = 5;
win.fieldpanel.panel3.top_input.characters = 5;
win.fieldpanel.panel4.bottom_input.characters = 5;
win.fieldpanel.check1 = win.fieldpanel.add('checkbox', undefined, "Equal");
//radiopanel
win.radiopanel.radio1 = win.radiopanel.add('radiobutton',undefined, "mm");
win.radiopanel.radio2 = win.radiopanel.add('radiobutton',undefined, "in");
win.radiopanel.radio3 = win.radiopanel.add('radiobutton',undefined, "px");
//radiopanel2
win.radiopanel2.radio1 = win.radiopanel2.add('radiobutton',undefined, "All Artboards");
win.radiopanel2.radio2 = win.radiopanel2.add('radiobutton',undefined, "Active Artboard");
//select first radio buttons
win.radiopanel.radio1.value = true;
win.radiopanel2.radio1.value = true;
//ok button
win.okbutton = win.add('button', undefined, "Ok");
//disable fields with checkbox and equal values
win.fieldpanel.check1.onClick = function() {
if(win.fieldpanel.check1.value){ var leftvalue = win.fieldpanel.panel1.left_input.text; win.fieldpanel.panel2.right_input.text = leftvalue; win.fieldpanel.panel3.top_input.text = leftvalue; win.fieldpanel.panel4.bottom_input.text = leftvalue; win.fieldpanel.panel2.right_input.enabled = false; win.fieldpanel.panel3.top_input.enabled = false; win.fieldpanel.panel4.bottom_input.enabled = false; } else { win.fieldpanel.panel2.right_input.enabled = true; win.fieldpanel.panel3.top_input.enabled = true; win.fieldpanel.panel4.bottom_input.enabled = true; }
};
//sync values while checked
win.fieldpanel.panel1.left_input.onChanging = function (){
if(win.fieldpanel.check1.value){ var leftvalue = win.fieldpanel.panel1.left_input.text; win.fieldpanel.panel2.right_input.text = leftvalue; win.fieldpanel.panel3.top_input.text = leftvalue; win.fieldpanel.panel4.bottom_input.text = leftvalue; }
};
//event listener for ok button
win.okbutton.onClick = function(){
var leftvalue = win.fieldpanel.panel1.left_input.text; var rightvalue = win.fieldpanel.panel2.right_input.text; var topvalue = win.fieldpanel.panel3.top_input.text; var bottomvalue = win.fieldpanel.panel4.bottom_input.text; if(win.radiopanel.radio1.value) { var multiplier = 2.834645669291339 } if(win.radiopanel.radio2.value) { var multiplier = 72 } if(win.radiopanel.radio3.value) { var multiplier = 1 } //close window win.close(); //make a margins layer var guideLayer = docRef.layers.add(); guideLayer.name = "Margins"; if(win.radiopanel2.radio1.value) { //repeat for each artboard for(i=0;i<artboardRef.length;i++){ //get artboard size var left=artboardRef[i].artboardRect[0]; var top=artboardRef[i].artboardRect[1] ; var right=artboardRef[i].artboardRect[2] ; var bottom=artboardRef[i].artboardRect[3] ; //create lines var lineLeft = docRef.pathItems.add(); var lineRight = docRef.pathItems.add(); var lineTop = docRef.pathItems.add(); var lineBottom = docRef.pathItems.add(); //set line points var leftmargin = (leftvalue * multiplier); var rightmargin = (rightvalue * multiplier); var topmargin = (topvalue * multiplier); var bottommargin = (bottomvalue * multiplier); //set line points lineLeft.setEntirePath([[left + leftmargin, top], [left + leftmargin, bottom]]); lineRight.setEntirePath([[right - rightmargin, top], [right - rightmargin, bottom]]); lineTop.setEntirePath([[left, top - topmargin], [right, top - topmargin]]); lineBottom.setEntirePath([[left, bottom + bottommargin], [right, bottom + bottommargin]]); //make lines guides lineLeft.guides = true; lineRight.guides = true; lineTop.guides = true; lineBottom.guides = true; }; } else { //get artboard size var activeAB = docRef.artboards[docRef.artboards.getActiveArtboardIndex()]; // get active AB var left = activeAB.artboardRect[0]; var top = activeAB.artboardRect[1] ; var right = activeAB.artboardRect[2] ; var bottom = activeAB.artboardRect[3] ; //create lines var lineLeft = docRef.pathItems.add(); var lineRight = docRef.pathItems.add(); var lineTop = docRef.pathItems.add(); var lineBottom = docRef.pathItems.add(); //set line points var leftmargin = (leftvalue * multiplier); var rightmargin = (rightvalue * multiplier); var topmargin = (topvalue * multiplier); var bottommargin = (bottomvalue * multiplier); //set line points lineLeft.setEntirePath([[left + leftmargin, top], [left + leftmargin, bottom]]); lineRight.setEntirePath([[right - rightmargin, top], [right - rightmargin, bottom]]); lineTop.setEntirePath([[left, top - topmargin], [right, top - topmargin]]); lineBottom.setEntirePath([[left, bottom + bottommargin], [right, bottom + bottommargin]]); //make lines guides lineLeft.guides = true; lineRight.guides = true; lineTop.guides = true; lineBottom.guides = true; }; //lock margins layer and activate original layer guideLayer.zOrder (ZOrderMethod.SENDTOBACK); guideLayer.locked = true; docRef.activeLayer = workingLayer;
};
win.show();
Box Margin Version:
#target illustrator
var docRef = app.activeDocument;
var artboardRef = docRef.artboards;
var workingLayer = docRef.activeLayer;
//window
var win = new Window('dialog', "Add Margins");
this.windowRef = win;
//panels
win.fieldpanel = win.add("panel", undefined, "");
win.radiopanel = win.add("panel", undefined, "");
win.radiopanel2 = win.add("panel", undefined, "");
//panel orientation
win.fieldpanel.orientation='row';
win.radiopanel.orientation='row';
win.radiopanel2.orientation='row';
//fieldpanel
win.fieldpanel.panel1 = win.fieldpanel.add('panel', undefined, "Left");
win.fieldpanel.panel2 = win.fieldpanel.add('panel', undefined, "Right");
win.fieldpanel.panel3 = win.fieldpanel.add('panel', undefined, "Top");
win.fieldpanel.panel4 = win.fieldpanel.add('panel', undefined, "Bottom");
win.fieldpanel.panel1.left_input = win.fieldpanel.panel1.add('edittext', undefined, "0");
win.fieldpanel.panel2.right_input = win.fieldpanel.panel2.add('edittext', undefined, "0");
win.fieldpanel.panel3.top_input = win.fieldpanel.panel3.add('edittext', undefined, "0");
win.fieldpanel.panel4.bottom_input = win.fieldpanel.panel4.add('edittext', undefined, "0");
win.fieldpanel.panel1.left_input.characters = 5;
win.fieldpanel.panel2.right_input.characters = 5;
win.fieldpanel.panel3.top_input.characters = 5;
win.fieldpanel.panel4.bottom_input.characters = 5;
win.fieldpanel.check1 = win.fieldpanel.add('checkbox', undefined, "Equal");
//radiopanel
win.radiopanel.radio1 = win.radiopanel.add('radiobutton',undefined, "mm");
win.radiopanel.radio2 = win.radiopanel.add('radiobutton',undefined, "in");
win.radiopanel.radio3 = win.radiopanel.add('radiobutton',undefined, "px");
//radiopanel2
win.radiopanel2.radio1 = win.radiopanel2.add('radiobutton',undefined, "All Artboards");
win.radiopanel2.radio2 = win.radiopanel2.add('radiobutton',undefined, "Active Artboard");
//select first radio buttons
win.radiopanel.radio1.value = true;
win.radiopanel2.radio1.value = true;
//ok button
win.okbutton = win.add('button', undefined, "Ok");
//disable fields with checkbox and equal values
win.fieldpanel.check1.onClick = function() {
if(win.fieldpanel.check1.value){ var leftvalue = win.fieldpanel.panel1.left_input.text; win.fieldpanel.panel2.right_input.text = leftvalue; win.fieldpanel.panel3.top_input.text = leftvalue; win.fieldpanel.panel4.bottom_input.text = leftvalue; win.fieldpanel.panel2.right_input.enabled = false; win.fieldpanel.panel3.top_input.enabled = false; win.fieldpanel.panel4.bottom_input.enabled = false; } else { win.fieldpanel.panel2.right_input.enabled = true; win.fieldpanel.panel3.top_input.enabled = true; win.fieldpanel.panel4.bottom_input.enabled = true; }
};
//sync values while checked
win.fieldpanel.panel1.left_input.onChanging = function (){
if(win.fieldpanel.check1.value){ var leftvalue = win.fieldpanel.panel1.left_input.text; win.fieldpanel.panel2.right_input.text = leftvalue; win.fieldpanel.panel3.top_input.text = leftvalue; win.fieldpanel.panel4.bottom_input.text = leftvalue; }
};
//event listener for ok button
win.okbutton.onClick = function(){
var leftvalue = win.fieldpanel.panel1.left_input.text; var rightvalue = win.fieldpanel.panel2.right_input.text; var topvalue = win.fieldpanel.panel3.top_input.text; var bottomvalue = win.fieldpanel.panel4.bottom_input.text; if(win.radiopanel.radio1.value) { var multiplier = 2.834645669291339 } if(win.radiopanel.radio2.value) { var multiplier = 72 } if(win.radiopanel.radio3.value) { var multiplier = 1 } //close window win.close(); //make a margins layer var guideLayer = docRef.layers.add(); guideLayer.name = "Margins"; if(win.radiopanel2.radio1.value) { //repeat for each artboard for(i=0;i<artboardRef.length;i++){ //get artboard size var top=artboardRef[i].artboardRect[1] ; var left=artboardRef[i].artboardRect[0]; var width=artboardRef[i].artboardRect[2]-artboardRef[i].artboardRect[0]; var height=artboardRef[i].artboardRect[1]-artboardRef[i].artboardRect[3]; //set margin sizes var leftmargin = (leftvalue * multiplier); var rightmargin = (rightvalue * multiplier); var topmargin = (topvalue * multiplier); var bottommargin = (bottomvalue * multiplier); //create box var box = docRef.pathItems.rectangle (top - topmargin, left + leftmargin, width - rightmargin - leftmargin, height - topmargin - bottommargin); box.fillColor = box.strokeColor = new NoColor(); //make box guides box.guides = true; }; } else { //get artboard size var activeAB = docRef.artboards[docRef.artboards.getActiveArtboardIndex()]; // get active AB var left = activeAB.artboardRect[0]; var top = activeAB.artboardRect[1] ; var width = activeAB.artboardRect[2]-activeAB.artboardRect[0]; var height = activeAB.artboardRect[1]-activeAB.artboardRect[3]; //set margin sizes var leftmargin = (leftvalue * multiplier); var rightmargin = (rightvalue * multiplier); var topmargin = (topvalue * multiplier); var bottommargin = (bottomvalue * multiplier); //create box var box = docRef.pathItems.rectangle (top - topmargin, left + leftmargin, width - rightmargin - leftmargin, height - topmargin - bottommargin); box.fillColor = box.strokeColor = new NoColor(); //make box guides box.guides = true; }; //lock margins layer and activate original layer guideLayer.zOrder (ZOrderMethod.SENDTOBACK); guideLayer.locked = true; docRef.activeLayer = workingLayer;
};
win.show();
Has anybody written a JS script to to draw a rectangle on an active document which would be exact size as the document's artboard?
I find it very inaccurate and cumbersome trying to draw such rectangle by hand.
Please let me know where such JS code can be found. I have not done any Illustrator scripting beyond the "Hello world".
Thanks
franK
I am trying to find a way to expedite translations of our drawings. Each drawing has a series of callouts showing what that piece of the drawing is via text. I would need to do 100's of drawings for each book.
Questions:
1. Can I write something to batch a folder and extract the name of the file, and the text from each textbox so that when I get the translation back, I can automate the reinsertion of the translated text to its correct field (i.e. TextField1 = "Translate this" then repopulate that same exact field with "Translation")? In order to do this I would think each text field would have to be tagged with some unique identifier so that it would know which translation goes where in the drawing. Keep in mind, I'm ok with manually tagging each textbox if necessary.
2. Assuming the above is possible, what would be the best program to write the extracted text to so that reading and writing the translated text back into the drawing is as easy as possible (i.e. Word, Excel, PDF)?
Hello.
How do I set a folder as a realtive path to where the script is running??
is there any easy way like in unix, starting without / ?
or for example
"~/Desktop/"
"/users/<login>/desktop/"
seems that path to me is the only way...
is there an easy way to change posix paths to applescript??
I have this code:
tell application "Finder" to set templateFile to (container of (path to me) as string) & "Graficas FINAL ADQAT.ai"
with this error:
error "No se ha encontrado el archivo Macintosh HD:Users:Vibra:Desktop:Graficas FINAL ADQAT.ai." number -43 from "Macintosh HD:Users:Vibra:Desktop:Graficas FINAL ADQAT.ai"
the file is there how I change the filepath to be compatible with applescript??
Hello,
From what I understand, you can't call complex functions from a scripted UI palette, only from "dialog" windows (which are usless in my case) because I need the persistance of a palette.
I have a series of scripts in use now that are accessed from the usual "file-scripts folder" within Illustrator itself (about 27 of them). I want to script a palette window so users can acces them without the usual mouse clicks down the menu system.
I'm able to call a simple "Hello World" type function using the "onClick()" method from a button of a scripted palette window, but I cannot use my regular working scripts inside a function that's called from the button. In X-Code, I was able to write my scripts individually, then just add them to a main floating window via a separate function when they were completed. But, I'm finding Javascript a little more tricky.
If I copy my other's script code into the function in the palette window script, it runs, but it runs before I click the button! -- After in runs, then the palette window is displayed(?). If I try to use the execute() method with "onClick", the script just opens in the SDK, it will not and does run in Illustrator.
I take both of these as clear indications that I have no clue what I'm doing (or that I'm trying to do the impossible).
I did find someone with a similar problem, but they were scripting After Effects and were offered this solution:
system.callSystem ('afterfx -r "/C/Program Files/Adobe/Adobe After Effects CS3/Support Files/Scripts/GlobalVars.jsx"');
Is there anything I can do in Illustrator that will allow me to call (or execute) my other scripts/functions and have them execute within Illustrator?
Thanks for any and all help!
Hi everybody,
I'm trying to create a script via javascript for Illustrator.
My problem is :
I have a AI file with multiple layers, i want to create one artboard per layer, in order to export a multipage PDF ( each page contain 1 layer ).
The layers represents the differents type of print ( vernish, color, hot gold, pressure ... ) and/or color type ( Pantone, CMYK, cut, kisscut ... ).
My client want a PDF for see each type of print or color type per page.
I'm trying 2 ways :
1st solution : Create new artboards, and duplicate ( or move ) layers content on the new artboad, but the function move/duplicate don't work to move content on another artboard.
2nd solution : Create new document with the same number of layers as artboard and duplicate layer to the new artboard on the new document.
Can you help me to realize this script ?
Excuse me if my english is not good.
Hello, I was wondering if anyone had a simple solution to aligning selected items to the artboard. I was going to create an action but then realized it would be more convenient for me to include it in my script file....I have a script to align objects with each other but they dont align to the artboard. Any suggestions?
From the readme:
"An Illustrator error occurred: 1346458189 ('PARM')" alert (1459349) Affects: JavaScript Problem: This alert may be popped when badly written scripts are repeatedly run in Illustrator from the ExtendScript Toolkit Scripters need to be very careful about variable initialization and namespace conflict when repeatedly pushing a batch of Illustrator scripts for execution in Illustrator via the ExtendScript Toolkit (ESTK) in a single Illustrator session. Each script run is executed within the same persistent ExtendScript engine within Illustrator. The ESTK debugger uses BridgeTalk to communicate with Illustrator. One global, persistent ExtendScript engine inside Illustrator handles all BridgeTalk communications. The net effect is that the state of the ExtendScript engine is cumulative across all scripts that ran previously. The following issues with script code can cause this problem: - Reading uninitialized variables. - Global namespace conflicts, like when two globals from different scripts clobber each other. Workaround: Initialize variables before using them, and consider the scope of your variables carefully. For example, isolate your variables by wrapping them within systematically named functions. Instead of: var myDoc = app.documents.add(); // Add code to process myDoc Wrap myDoc in a function that follows a systematic naming scheme: function myFeatureNameProcessDoc() { var myDoc = app.documents.add(); // Add code to process myDoc } myFeatureNameProcessDoc();
This makes zero sense to me. If javascript variables are being reused or 'clobbered' or your javascript is 'poorly written' (this is not defined) it should have no effect on the scripting engine. Errors should cause exceptions to be thrown, which can be caught by the script. I'm getting these errors when I try to evaluate properties of valid objects, for instance trying to access pathItem.fillColor. It's happening in various (almost random) lines in my script. Javascript doesn't have namespaces so I don't know what a 'namespace confilct' would be. Accessing variables from nested functions also seems to be a problem.
Edit - this seems to be related to accessing global variables or variables defined in containing functions. For now, adding var to the first use in subfunction seems to have fixed the problem. What is strange is you don't get an undefined variable error, it just crashes when it tries to access the properties.
Edit - still not fixed. I'm guessing it has something to do with memory allocation, because I am processing a lot of big raster images in todays batch of files.
Edit - processed 84 files today with no errors the pattern I'm using is to use a bach file that loops
"(Path)/Extend Script Toolkit.exe" -run script
sleep 10
The script opens a group of files (in my case JSON files), processes one file, exports an ai file, deletes the JSON file, then exits.
Hi guys, I found a script that does the job, export tones of ai files to pdf, but I have some files which are in sub folders, and I was trying to find a way to modify this script to include subfolder, but no luck.
Would appriciate if anyone colud help.
Thanks.
/**********************************************************
ADOBE SYSTEMS INCORPORATED
Copyright 2005-2006 Adobe Systems Incorporated
All Rights Reserved
NOTICE: Adobe permits you to use, modify, and
distribute this file in accordance with the terms
of the Adobe license agreement accompanying it.
If you have received this file from a source
other than Adobe, then your use, modification,
or distribution of it requires the prior
written permission of Adobe.
*********************************************************/
/**********************************************************
Export to PDFs.jsx
DESCRIPTION
This sample gets files specified by the user from the
selected folder and batch processes them and saves them
as PDFs.
Edits by Patrick Mineault:
- only .ai files processed
- files saved in same folder as the input files
- export files have name (oldname).pdf
- PDF settings: editable / acrobatLayers=true
for maximum compatibility with Preview
**********************************************************/
// Main Code [Execution of script begins here]
// uncomment to suppress Illustrator warning dialogs
// app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, pdfSaveOpts;
// Select the source folder.
sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator .ai files you want to convert to PDF');
// If a valid folder is selected
if ( sourceFolder != null )
{
files = new Array();
fileType = "*.ai"; //prompt( 'Select type of Illustrator files to you want to process. Eg: *.ai', ' ' );
// Get all files matching the pattern
files = sourceFolder.getFiles( fileType );
if ( files.length > 0 )
{
// Get the destination to save the files
//destFolder = Folder.selectDialog( 'Select the folder where you want to save the converted PDF files.', '~' );
destFolder = sourceFolder;
for ( i = 0; i < files.length; i++ )
{
sourceDoc = app.open(files[i]); // returns the document object
// Call function getNewName to get the name and file to save the pdf
targetFile = getNewName();
// Call function getPDFOptions get the PDFSaveOptions for the files
pdfSaveOpts = getPDFOptions( );
// Save as pdf
sourceDoc.saveAs( targetFile, pdfSaveOpts );
sourceDoc.close();
}
alert( 'Files are saved as PDF in ' + destFolder );
}
else
{
alert( 'No matching files found' );
}
}
/*********************************************************
getNewName: Function to get the new file name. The primary
name is the same as the source file.
**********************************************************/
function getNewName()
{
var ext, docName, newName, saveInFile, docName;
docName = sourceDoc.name;
ext = '.pdf'; // new extension for pdf file
newName = "";
for ( var i = 0 ; docName[i] != "." ; i++ )
{
newName += docName[i];
}
newName += ext; // full pdf name of the file
// Create a file object to save the pdf
saveInFile = new File( destFolder + '/' + newName );
return saveInFile;
}
/*********************************************************
getPDFOptions: Function to set the PDF saving options of the
files using the PDFSaveOptions object.
**********************************************************/
function getPDFOptions()
{
// Create the PDFSaveOptions object to set the PDF options
var pdfSaveOpts = new PDFSaveOptions();
// Setting PDFSaveOptions properties. Please see the JavaScript Reference
// for a description of these properties.
// Add more properties here if you like
pdfSaveOpts.acrobatLayers = true;
pdfSaveOpts.colorBars = false;
pdfSaveOpts.colorCompression = CompressionQuality.AUTOMATICJPEGHIGH;
pdfSaveOpts.compressArt = true; //default
pdfSaveOpts.embedICCProfile = true;
pdfSaveOpts.enablePlainText = true;
pdfSaveOpts.generateThumbnails = true; // default
pdfSaveOpts.optimization = true;
pdfSaveOpts.pageInformation = false;
pdfSaveOpts.preserveEditability = true;
return pdfSaveOpts;
}
Hello everyone,
I am trying to open some documents in Illustrator CS4 by javascript, walk through all layers including sublayers, doing something (for now just reading the layernames and showing them at an alert), closing the document and continue with the next document in the given folder until all documents in that folder are done.
By doing so I found an error I never have seen so far and I cant figure out where it comes from exactly to get rid of it.
The Error an Illustrator error occurred: 1346458189 ('PARM') appears randomly when cycling through the layers of the document but only every second document, so I guess there might be something wrong with closing a document and realeasing all references but I could not figure out what.
Maybe someone got an idea on this problem? Posting my sourcecode (just a simple test-code) below.
#target illustrator
var sourceFolderPath = "/e/TestAI";
var destinationFolderPath = "/e/TestZielverzeichnis";
var fileNameDefinition = "*.ai";
var sourceFolder = new Folder(sourceFolderPath);
var destinationFolder = new Folder(destinationFolderPath);
runCheckTool();
function runCheckTool() {
var contentInput = sourceFolder.getFiles(fileNameDefinition);
var fileRef;
var docRef;
for (var i = 0; i < contentInput.length; i++) {
fileRef = null;
docRef = null;
try {
fileRef = new File(contentInput[i]);
docRef = open(fileRef);
} catch(e) {
alert("# 1: " + e);
}
try{
checkLayers(docRef.layers);
} catch(e) {
alert("# 2: " + i + " " + e);
}
try {
docRef.close(SaveOptions.DONOTSAVECHANGES);
alert("end file index: " + i);
} catch(e) {
alert("#3: " + e);
}
}
}
function checkLayers(layerRef) {
var countLayers = layerRef.length;
for (var j = countLayers - 1; j >= 0; j--) {
if(layerRef[j].layers.length > 0) {
checkLayers(layerRef[j].layers);
}
alert ("Layer: " + layerRef[j].name);
}
}
Hi all,
I need to check the duplicate text in the eps files.
(i.e) In the images the text frames are same for example "apple" text which appears in the eps files more than 2 or etc. How to check.
either error message or the duplicate text to be highlighted.
Thanks in advance
Vinoth
Hi all,
I was advised that I could call c++ libraries if I wanted to use some command that DOM didn't offer. I wanted to give it a try with the "select all" command but I never figured it out.
I found the .h file that seems to include the "select all" function but I have no clue on how to call it from JSX, does someone has an idea on how to do that ?
Thanks in advance for any help on that topic.
Loic
I have created this script for selecting open paths in illustrator cs6 as the graffix plugin is not working under CS6.
Just save the following text in /Applications/Adobe Illustrator CS6/Presets/en_US/Scripts/Select Open Paths.js