Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all 12845 articles
Browse latest View live

Ai Packaging Script

$
0
0

Ok.. I'm sure this has been posted before (already searched, didn't find however), but does a file packaging script exist for AI? (one that collects all linked images and fonts and places them in one place) This would be IMMENSELY helpful to me if anyone can post a link to one or even be willing to write it.

 

OS: W7

AI Version: CS5

 

Thanks in advance!


Resolution check in illustrator

$
0
0

How to check the raster image resolution in illustrator through script?

Cant search russian text

$
0
0

Hello, how can I get a script that searches a word to work with russian text? It ignores any content and searchs only in english and digits.

Startup Script for Illustrator only

$
0
0

Hi,

 

I've made a nice palette script for Illustrator CS6 on OSX 10.6.8.

I put it into HD/Library/Application\ Support/Adobe/Startup\ Scripts\ CS6/Illustrator

 

I works fine in Illustrator.

 

BUT: If I start Indesign CS6, the palette show up twice and it is not possible to close both pallettes.

 

Any hints?

 

Next question: The palette is used to have an easy access to script. If I start the scripts with the palette, the error messages of the scripts are not displayed. If I start individal script directly in Illustrator errors are displayed. What can I do?

 

Thanks for your help.

 

 

 #target illustrator;

#targetengine main;

//var pfad = "/Applications/Adobe\ Illustrator\ CS6/Presets.localized/de_DE/Skripten/"
var pfad = "/Volumes/Platte/Hilfsmittel/Skripte/"

var win = new Window('palette', 'Daniels Zauberkiste');
var tpanel = win.add ("tabbedpanel");
tpanel.alignChildren = ["fill", "fill"];
tpanel.preferredSize = [100,20];
win.margins = 0;
win.spacing = 0;
var subtab1panel = tpanel.add ("tab", undefined, "allgemein");
subtab1panel.orientation="row";
subtab1panel.alignChildren = ["fill", "fill"];


var t1group = subtab1panel.add("group");
t1group.orientation = "column";
t1group.alignChildren = ["fill", "fill"];


var btnSelect1 = t1group.add('button', undefined, 'Passer');
var scriptToLoad1 = new File(pfad+"_Passer-Montage.jsx");
var btnSelect2 = t1group.add('button', undefined, 'Prüfpasser');
var scriptToLoad2 = new File(pfad+"_Prüfpasser-Montage.jsx");
var btnSelect3 = t1group.add('button', undefined, 'Kontur+10');
var scriptToLoad3 = new File(pfad+"_Kontur+Dok+10.jsx");
var btnSelect4 = t1group.add('button', undefined, 'Kontur+20');
var scriptToLoad4 = new File(pfad+"_Kontur+Dok+20.jsx");
var btnSelect5 = t1group.add('button', undefined, 'Standardbogen Stanze');
var scriptToLoad5 = new File(pfad+"_Bogengröße.jsx");


btnSelect1.onClick = function(){
      var des = scriptToLoad1;   des.open("r");         var bt = new BridgeTalk;   bt.target = "illustrator";         var script = des.read();   des.close();              bt.body = script;   bt.send();  
}// end function


btnSelect2.onClick = function(){
      var des = scriptToLoad2;   des.open("r");         var bt = new BridgeTalk;   bt.target = "illustrator";         var script = des.read();   des.close();              bt.body = script;   bt.send(); 
}// end function


btnSelect3.onClick = function(){
      var des = scriptToLoad3;   des.open("r");         var bt = new BridgeTalk;   bt.target = "illustrator";         var script = des.read();   des.close();              bt.body = script;   bt.send();
}// end function


btnSelect4.onClick = function(){
      var des = scriptToLoad4;   des.open("r");         var bt = new BridgeTalk;   bt.target = "illustrator";         var script = des.read();   des.close();              bt.body = script;   bt.send();
}// end function


btnSelect5.onClick = function(){
      var des = scriptToLoad5;   des.open("r");         var bt = new BridgeTalk;   bt.target = "illustrator";         var script = des.read();   des.close();              bt.body = script;   bt.send();
}// end function










win.center();
win.show();

How to select multiple pathPoints?

$
0
0

Hello,

         i'm getting conflicting answers for wether its possible to select pathPoints at all, but could anyone please describe how to select multiple pathPoints?, if its possible.

 

I've had some success by writing a simple script that accesses pathPoints then aligns them with the manually chosen, highest point (highest Y value):

 

var firstPath = app.activeDocument.pathItems[1];                                    

var countOfPoints = firstPath.pathPoints.length;

var index               = 0;                                                                                  

 

for(index=0; index<=countOfPoints; index++)

{

var currentPoint        = firstPath.pathPoints[index];                                               

currentAnchorList     = currentPoint.anchor;

TopY                         = app.activeDocument.pathItems[1].pathPoints[0].anchor[1];

currentPoint.anchor = Array(currentAnchorList[0],TopY);                                   

}

 

...it works but is not finished.

It shows however that existing pathPoints can be edited/manipulated in almost every way, except there does NOT appear to be any way to perform the simpler task of selecting pathPoints or anchor points?

 

The closest i've found is: ..pathItems.selected = true;  ..but this does Not work when applied to pathPoints\Anchors, IE:

 

app.activeDocument.pathItems[1].pathPoints[index].anchor.selected = true;   ..AND,..

app.activeDocument.pathItems[1].pathPoints[index].selected = true;

 

...both fail to select any points.

 

1) please reply if you know how to select pathPoints and\or anchor points?, and\or have any alternative suggestions\instructions.

thanks much for any assistance,.

J

Batch creation of variables

$
0
0

A client works with CS4 on a map with about 2000 text boxes that need to be exported for translation.

 

Is there a way to batch process the file so that all the text boxes are assigned a variable for export in XML ?

 

Thank you in advance for the replies.

 

Jean-Christophe Helary

Is it possible to get Adobe Illustrator CS 5 server license?

$
0
0

Hi,

We need to deploy Adobe Illustrator on the server and then call it through script so that it could convert raster image provided through script into FXG format file. The implementation is for commercial use. Please let me know the process and possibility of getting license.

 

-Gauri

Errors and more, my first illustrator script

$
0
0

First, I should mention that I started scripting for Photoshop about a month ago and have had some really motivating successes there. It led me to this one task we have that is just incredibly repetitive and boring in Illustrator that I want to script.

 

I haven't gotten all the pieces in here that I need so far, and any form of help would be greatly appreciated, whether just suggestion, or really whatever. I don't mind doing research and trying things out myself.

 

The purpose of this script is to open a template file we have on our network drive, ask for a folder with a collection of files (these are files provided to us that contain the info we need to make labels), place one, save with a specific name, and start over, placing the next file, till they are all on the template. We do this before we can create labels for our products. There are weeks when it has to be done 50+ times and that's pretty mind-numbing.

 

The steps I think I need are:

  • ask where the provided files are that need to be placed
  • open template file
  • make sure the folder chosen has the right type of stuff in it (PDFs)
  • place the first file at specified coordinates
  • embed the link
  • lock the embedded link
  • ask user to proof information on screen (ok to continue, cancel to stop and let user interact with file on their own) (95% of the time, there are no errors)
  • use the embedded link's name as the name of the file and save it to a specific network location
  • repeat until all the files in the chosen folder have been done

 

I've been lurking around here for a couple days, reading up on how Illustrator works with scripting and have broken off bits and pieces of different scripts to adapt for my purposes. So far, this is what I've come up with:

 

function getLabelRequests() {

     return Folder.selectDialog('Please select the folder containing label requests:', Folder('~/Desktop'));

     }

 

     function placeLabelRequests(selectedFolder) {

          var myDoc;

 

          if (selectedFolder) {

          var fileRef = File("/Volumes/myNetworkLocation/myTemplateFile.ai")

          open(fileRef);

          myDoc = app.activeDocument;

 

          var firstImageLayer = true;

          var thisPlacedItem;

 

          // create document list from files in selected folder

          var fileList = selectedFolder.getFiles();

 

          for (var i = 0; i < fileList.length; i++) {

          // open each document in file list

          if (fileList[i] instanceof File) {

          // get the file name

          var fName = fileList[i].name;

          // check for supported file formats

          if( (fName.indexOf(".pdf") == -1)) {

               // skip unsupported formats

               continue;

               } else {

                    // Give the file the name of the image file

                    File.name = fName.substring(0, fName.indexOf(".") );

 

                    // Place the label request on the artboard

                    thisPlacedItem = myDoc.layers['Job Form'].placedItems.add();

                    thisPlacedItem.file = fileList[i];

                    thisPlacedItem.position = [15,-45];

                    thisPlacedItem.embed();

                    }

               }

          }

     }

 

     if( firstImageLayer ) {

     // display error message

     alert("Sorry, but the designated folder does not contain any recognized image formats.\n\nPlease choose another folder.");

     myDoc.close();

     getLabelRequests (placeLabelRequests());

     }

 

     else {

     // display error message

     alert("Rerun the script and choose a folder with label requests, if you please.");

     }

}

 

// Start the script off

placeLabelRequests (getLabelRequests ());

 

 

So obviously there's no loop in there, which is one of my problems at this point. I know what each of these chunks of code do, but can't necessarily understand all the syntax. Particularly things like

for (var i = 0; i < fileList.length; i++) {

I know it's saying that the variable i is zero, and while the list of files is greater than i, do whatever that last bit means, but I don't really know why it works or how it was constructed originally.

 

I haven't specified the save either, which might be why I'm running another of my problems, but I don't know how to get the name of the link to be the name of the file when it's saved. I also haven't given it a confirm to let the user proof either.

 

Here's my list of problems:

  • Running the script returns the image format error, even though the folder selected contains PDFs (I suppose I don't need to confirm the files are PDFs, that could just be incumbent upon the user)
  • Running the script places all the files into one iteration of the template (this may be because I haven't gotten the save or the loop in there, but I think it has more to do with the function being set up the way it is)
  • Obviously, it doesn't save with the link name as the file name
  • I don't seem to be able to figure out how to lock the link after it's embedded.

 

I also wonder if there's a way to, rather than opening-placing-saving-closing-repeat, to open-place-save, delete-placenext-save, delete-placenext-save.

 

Phew, sorry for the short novel.

 

Here is a copy of the template … or not. Can I not embed files in the post that aren't images?

 

Here's a JPG of the AI file that I use as a template

Label Job Form-5C-01.jpg

This document has two layers in this order normally:

Artwork

Job Form

 

 

And here are the blocks I'm using as placement for the information we are provided. These are taking the place of the files that need to be placed, and again, were PDF files, but I'm uploading as JPGs because I either don't know what I'm doing, or you can't upoad those file types.

PlaceMe.jpg

PlaceMe 2.jpg

PlaceMe 3.jpg


Change font in Illustrator cs4 js

$
0
0

I need to assign specific font to my text and it doesn't work. What am I doing wrong:

 

 

var my_OUTSIDE_TextFrame = myInstrLayer.textFrames.add();
my_OUTSIDE_TextFrame.geometricBounds = ["1.6 in", "1 in", "1.85 in", "2.75 in"];
my_OUTSIDE_TextFrame.contents = "OUTSIDE";

var myParagraph = my_OUTSIDE_TextFrame.paragraphs.item(0);
try{
myParagraph.appliedFont = app.fonts.item("Myriad Pro");

}
catch(e){}
try{
myParagraph.fontStyle = "Bold";
}
catch(e){}

myParagraph.pointSize = 30;

 

And it's not placing it where I want it either.

 

Thank you very much for your help.

Yulia

Split Text into Layers

$
0
0

I was wondering if anyone is aware of a script that is able to do the same as this photoshop one http://www.agasyanc.ru/text-splitter, I would use that one in photoshop but its not working in CS6.

 

I  was hoping to find a script that will seperate the text into layers  ready for export to After Effects to be used in Kinetic Typography  pieces

 

thank you

Anything similar to javascript's setInterval in ExtendScript?

$
0
0

I need a way to poll my server for new jobs for the illustrator script to work on every few hours.

I tried with $.sleep(), but that is blocking, I need a non-blocking way to do this.

Any advice?

 

Thanks!

Kashmira

Importing Color to Swatch Library from Text File

$
0
0

Hi,

I have a large list of custom colors in Excel that has the color name and CMYK breakdown of each color. I'm looking for a way to import this information to create a custom Color Swatch Library. That will have the name of the color and the CMYK breakdown. So that I can easily use in Illustrator and Photoshop. Is there any way or application in doing this with out manually entering the information and creating a new library?

 

Thanks!

live trace (vectorisation de l'image)

$
0
0

i would like to live trace (vectoriser) a pdf drawing but i can't open the dialog box live trace(vectorisation de l'image) on version 17,1  could you help ?

p.s. my illustrator is french version but i understand english writing

How to change a swatch color without losing the "global" status

$
0
0

Hiya Forum! AppleScripting-Newbie talking.

 

For an automated EPS-export using AppleScript and Illustrator CS4 on a G5 Mac running Mac OS X I need to change a global swatch's color. It needs to go form black:75 to black:55 and remain global, thereby changing the color of all the path items in the document. It works very well with a doubleclick on the swatch.

While changing the color seems to be quite trivial with "set properties of swatch to {color:{black:55}}", it then loses the global.

All my beatiful boxes remain dark grey, looking awful and depressed.

Please tell me there's a way to help me!

Thank you very much!

 

I hope I gave you all the information you may need. If I didn't please tell me so my next questions will be more accurate.

Edit csv

$
0
0

Hello everyone, I have a small script that loads data from a CSV file into a listbox, I wonder how do I replace a selected data by a new one that will be typed in EditText and saving the change in the CSV, I have a script that I add new text at the end of the CSV more need to edit existing data, does anyone have any idea how to do this?.

 

I thank


ExportType.SVG "Use Artboards" option

textFont

$
0
0

Hi,

Here is a script from Muppet Mark (until it does not work anymore ;-) ) I modified but I am stucked at line 25

If I comment it it works.

 

 

JPD

 

    ----------------------   Noname1.txt   ----------------------


1 /* target illustrator */
2
3 function main() {
4 if (app.documents.length == 0) {
5 alert("Please have an 'Illustrator' document before running this script.");
6 return;
7 }
8
9 var docRef = app.activeDocument;
10
11  with (docRef) {
12  var thisDate = getTodaysDate();
13  var docName = name;
14  var rectRef = pathItems.rectangle(-72,0,600,84); // T,L,W,H
15  var tcLayer = layers.add();
16  var areaTextRef = tcLayer.textFrames.areaText(rectRef);
17  var docRef=app.activeDocument;
18  var docName=activeDocument.name;
19  var droits = "Copyright " + getTodaysDate();
20  var texte = "\rThis work may not be reproduced electronically nor reprinted without permission of the copyright holder.";
21  var textString =droits + "\rjeanpierredaviau.com\r" + docRef.fullName + "  " + texte;
22  tcLayer.name = 'Copyright';
23  tcLayer.zOrder(ZOrderMethod.SENDTOBACK) ;
24  areaTextRef.textRange.characterAttributes.size = 10;
25  //textRef.textRange.characterAttributes.textFont =textFonts.getByName(textFonts[i].name);
26  areaTextRef.textRange.characterAttributes.TextFont.typename =  textFonts.getByName("Adobe TextPro-It");
27  areaTextRef.contents = textString;
28  }
29 }
30
31 main();
32
33 function getTodaysDate() {
34 var today = new Date();
35 var dd = today.getDate();
36  if (dd < 10) {dd ='0' + dd};
37
38 var mm = today.getMonth() + 1;
39  if (mm < 10) {mm ='0' + mm};
40
41 var yyyy = today.getFullYear();
42 var heure=today.getHours() + ":" + today.getMinutes();
43
44 var thisDate = dd + '/' + mm + '/' + yyyy + "  " + heure;
45
46
47 return thisDate;
48 }
49

How To Convert Illustrator's PlacedItem Matrix to Artboard Coordinates ?

$
0
0

Hi,

 

How can I convert this matrix to a one that actually transforms a PageItem in the document ? Seems like PlacedItem's matrix is defined in a very mysterious coordinate system that never been mentioned anywhere in the documentation.

 

regards

Resolution check in illustrator

$
0
0

How to check the raster image resolution in illustrator through script?

Script for Selecting Open Paths in Illustrator CS6

$
0
0

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

 

 

if (documents.length > 0 && activeDocument.pathItems.length > 0){
 
          var allPaths = activeDocument.pathItems;
          var allPathsCount = allPaths.length;
          var openPathsAreLocked = false;
          var lockedOpenPaths = 0;
          var locked = false;
          for (var i=0; i < allPathsCount; i++){
                    allPaths[ i ].selected = false;
 
                    if( ! allPaths[ i ].closed){
 
                              try{
                                        allPaths[ i ].selected = true;
                              } catch (e) {
                                        openPathsAreLocked = true;
                                        lockedOpenPaths++;
                              }
 
                    }
          }
          if (openPathsAreLocked) alert (lockedOpenPaths + " open paths are locked or hidden (or their layer is locked or hidden) and cannot be selected");
}
Viewing all 12845 articles
Browse latest View live