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

Execute JavaScript via Applescript

$
0
0

Hi

 

There is a way to execute JavaScript via Applescript in InDesign using do script

 

tell application "Adobe InDesign CC 2014"     activate     do script "Macintosh HD:Applications:MAMP:htdocs:extendscript-library.org:tests:test:fixtures:helper:log:test_log.jsx" language javascript 
end tell

 

Since command do script doesn't work for Illustrator, Is there a way to tell via AppleScript to:

1. Execute Script from custom location (⌘cmd + F12)

2. Pick the script to be executed by name

 

Perhaps there is other work around to do this? Any support via OS X JavaScript?


batch converting .ai to .png in specific size

$
0
0

hi.  i'm totally new to scripting and could use some help.  i have a bunch of illustrator cs5 files (actually some of them might be older cs versions).  they all have an artboard size of 200 x 200.  i need to resize them to 700 x 700 and save them as png24 preserving transparency and keeping the same file name.  is this possible?  if so, any examples?  thanks in advance!!!!

Convert .ai to .doc

$
0
0

Hi,

 

Can it be possible to convert .ai file into .doc file or any tool which will do this conversion.

 

Thanks,

Shail

Coloring map from data sheet like excel

$
0
0

Hello

 

Is there a way to color a map from data sheet like excel? I'm thinking of splitting a country into regions and bind the paths to a variable that can be change by importing a data sheet.

 

Has anyone here got experience with this?

Convert complex RGB gradient mesh to CMYK

$
0
0

I posted this question in the Illustrator forum but thought I would ask the scripting world too....

Is there a way via script to convert all of the gradient mesh points individually with script?

I bought this stock art vector file for printing some design work I am working on. It never showed the color mode of the file. Turns out it is RGB. So I try to convert it to CMYK and it screws up the entire file. I have included screen shots of what the file does and would appreciate any fixes anyone might have so I can have this CMYK mode.

ORIGINAL - RGB

Capture-RGB.PNG

CONVERTED TO CMYK

Capture-CMYK.PNG

OUTLINE MODE (to see the complexity)

Capture-outline.PNG

 

Need help with a short Illustrator Script

$
0
0

Hello Illustrator Scripting Community,


I'm searching a long time for a solution with a short Illustrator Script. Maybe you can help me.

If you have any idea how to solve my problem via "actions" I would also bei very happy.


The following I need to do.

1. Open several Files each by each in Adobe Illustrator (this is also possible with actions)

2. Select all graphics inside of the file (this is also possible with actions)

3. via the Panel "Links" I need to use the function "embed picture(s)" (this is not working to record this part for an action)


My question ist now. Is there any other way to get "embed picture(s)" into any action recorded or do I need to have a Illustrator Scrip which solves the hole three steps for me? If so, is anybody able to write this script, because I have no idea of scripting in Illustrator.


Thank you very much for your help

best regards

Daniel

Apply Live Effect: Inner Glow with color

$
0
0

With help of some great information, Prometheus-like, we have been given the access to the syntax which makes pageItem.applyEffect(); work

 

Re: PageItem.applyEffect(LiveEffectXML)

 

This is great to start out with when the components which make up the 'Dict data="' string are in a straight-forward syntax where there is a data type, a name key and a value to form each component. They just need to be strung together like so:

  1. xmlstring = '<LiveEffect name="Adobe Offset Path"><Dict data="R mlim 4 R ofst 20 I jntp 2 "/></LiveEffect>'

 

I am able to almost accomplish my goal of applying an Inner Glow, but I can't figure out the syntax needed to supply the glow color to go along with it. It always defaults to white.

 

Here is the code so far which applies a glow only with white default:

#target illustrator
function test(){  var effectStr =    '<LiveEffect name="Adobe Inner Glow">' +        '<Dict data="' +            'I gtyp 0 ' +            'R blur 14.4 ' +           'I blnd 3 ' +           'R opac 1 ' +           '" ' +       '/>' +   '</LiveEffect>';  var doc = app.activeDocument;  var s = doc.selection[0];  s.applyEffect(effectStr);
};
test();

 

Here is the string inside the .AI file I saved without compression and opened it as text:

/BasicFilter :

(Adobe Inner Glow) 1 0 /Filter ,

1 /Visible ,

(Adobe Illustrator.app) /PluginFileName ,

(Inner Glow) /Title ,

/Dictionary : /NotRecorded ,

0 /Int (gtyp) ,

/FillStyle : 0 O

0.03 0 0.29 0 k

0 1 0 0 0 Xy

0 J 0 j 1 w 10 M []0 d

0 XR

0 1 Xd

/Def ;

(gclr) ,

14.4 /Real (blur) ,

1 /Real (opac) ,

3 /Int (blnd) ,

; /Dict ;

 

The color information is located here:

/FillStyle : 0 O

0.03 0 0.29 0 k

0 1 0 0 0 Xy

0 J 0 j 1 w 10 M []0 d

0 XR

0 1 Xd

/Def ;

(gclr) ,

 

While the rest of the 4 properties are working in my attempt above, I can't get the right syntax for putting in that color.

By the way, when applying this effect with experimentation strings added, the result could be an error-less application of the effect with default white or a MRAP, depending on whether you crossed some line of what the acceptable syntax is. I have tried adding new attributes and tags, and it still worked in the default way. Then I tried to add a nested tag inside the Dict tag, and got a MRAP. Whoever is able to solve this puzzle shall be rewarded with several emojis.

Is it possible to get the items on a specific artboard with script?


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

Script for closing the open paths on Illustrator CC2015

$
0
0

Can someone give me a script to close all the open paths on Illustrator CC2015 ?  Thanks.

Script for Copy and Paste Object from one Ai file to another Ai file.

$
0
0

Is it possible to create script that will take object (Text and Images) form one and AI file and placed them into another AI file in specific layer and location?

 

When I do it manually:

 

#1 - Create Banner Design (Text and Images)

# 2 - Outline the text and group it with images to make it one object.

# 3 - Copy the group object

# 4 - Open another Ai file

# 5 - Paste it into specific layer and adjust location

 

We do this to individually customize documents and it is very time consuming.

 

Feel free to contact me directly, we will consider to hire programer to help us.

Convert to Grayscale

$
0
0

Hello,

 

It is possible to apply the Convert to Grayscale(Edit->Edit Colors->Convert to Grayscale) for the selected items in illustrator cs3 in script (javascript)?

Kindly advice me the possiblities.

 

I'm a begginer I hope somebody help me

Thanks a lot

Florin

How to divide all textFrames in one-character-per-textFrame?

$
0
0

Hello:

 

How to divide all textFrames in one-character-per-textFrame?

 

Example: the textFrame "Letters" will be divided in 7 textFrames: "L", "e", "t", "t", "e", "r", "s".

 

Help, please.

batch converting .ai to .png in specific size

$
0
0

hi.  i'm totally new to scripting and could use some help.  i have a bunch of illustrator cs5 files (actually some of them might be older cs versions).  they all have an artboard size of 200 x 200.  i need to resize them to 700 x 700 and save them as png24 preserving transparency and keeping the same file name.  is this possible?  if so, any examples?  thanks in advance!!!!

Coloring map from data sheet like excel

$
0
0

Hello

 

Is there a way to color a map from data sheet like excel? I'm thinking of splitting a country into regions and bind the paths to a variable that can be change by importing a data sheet.

 

Has anyone here got experience with this?


Can javascript execute pathfinder commands?

$
0
0

Can javascript execute menu commands such as pathfinder options?

Warp ?

$
0
0

I can't locate any reference to the warp tool in the reference guide ?

REMOVE QUOTES IN TEXT.

$
0
0

Hello friends, I am using a CSV file to populate a form in illustrator but which contains text fields are getting texts QUOTES

 

EXAMPLE:

 

instead of> MODEL <is filling> "MODEL" <

 

How do I remove QUOTES, tried using the REPLACE METHOD but could not.

 

Could anyone help me?

 

 

The script I'm creating is this:

 

#target illustrator

 

var sourceDoc = app.activeDocument;

var aFile = File ("~/Desktop/teste form com CSV.csv");

aFile.open("r");

var txtFile = aFile.read();

aFile.close();

 

var iText = txtFile.split("\n");

 

alert(iText)

var multTexts = new Array (iText.length-1);

var myTextFrame

var Dateformat = "dd/mm/yy";

 

function TodayDate()

{

  var Today = new Date();

  var Day = Today.getDate();

  var Month = Today.getMonth() + 1;

  var Year = Today.getYear();

  var PreMon = ((Month < 10) ? "0" : "");

  var PreDay = ((Day < 10) ? "0" : "");

  if(Year < 999) Year += 1900;

 

           var theDate = Dateformat.replace(/dd/,PreDay+Day);

          theDate = theDate.replace(/mm/,PreMon+Month);

          theDate = theDate.replace(/d/,Day);

          theDate = theDate.replace(/m/,Month);

          theDate = theDate.replace(/yyyy/,Year);

          theDate = theDate.replace(/yy/,Year.toString().substr(2,2));

 

          return theDate;    

}

 

for (i=1; i<iText.length-1; i++) {

 

    T=iText[i].split( ",");

 

    texto=iText[i];

 

myTextFrame=sourceDoc.textFrames.getByName("CLIENTE");   

myTextFrame.contents=T[0];

 

myTextFrame=sourceDoc.textFrames.getByName("COD");

myTextFrame.contents=T[1];

 

myTextFrame=sourceDoc.textFrames.getByName("MODELO");

myTextFrame.contents=T[2];

 

myTextFrame=sourceDoc.textFrames.getByName("REV");

myTextFrame.contents=T[3];

 

myTextFrame=sourceDoc.textFrames.getByName("DESENHISTA");

myTextFrame.contents=T[4];

 

myTextFrame=sourceDoc.textFrames.getByName("MATERIAL");

myTextFrame.contents=T[5];

 

myTextFrame=sourceDoc.textFrames.getByName("ADESIVO");

myTextFrame.contents=T[6];

 

myTextFrame=sourceDoc.textFrames.getByName("TUBETE");

myTextFrame.contents=T[7];

 

myTextFrame=sourceDoc.textFrames.getByName("ROLOS/PACOTES");

myTextFrame.contents=T[8];

 

myTextFrame=sourceDoc.textFrames.getByName("ESPV");

myTextFrame.contents=T[9];

 

myTextFrame=sourceDoc.textFrames.getByName("ESPH");

myTextFrame.contents=T[10];

 

myTextFrame=sourceDoc.textFrames.getByName("PUXADA");

myTextFrame.contents=T[11];

 

myTextFrame=sourceDoc.textFrames.getByName("CARREIRAS");

myTextFrame.contents=T[12];

 

myTextFrame=sourceDoc.textFrames.getByName("NOME ARQUIVO");

myTextFrame.contents=T[13];

 

myTextFrame=sourceDoc.textFrames.getByName("BOBINAMENTO");

myTextFrame.contents=T[14];

 

myTextFrame=sourceDoc.textFrames.getByName("DATA");

myTextFrame.contents=TodayDate();

 

}

var destFilePath = "~/Desktop/"+T[13]+"_ARTE.ai"

 

alert(destFilePath)

 

function exportFileToAI (dest) {

    if ( app.documents.length > 0 ) {

        var saveOptions = new IllustratorSaveOptions();

        var ai8Doc = new File(dest);

        saveOptions.compatibility = Compatibility.ILLUSTRATOR16;

        saveOptions.flattenOutput = OutputFlattening.PRESERVEAPPEARANCE;

        app.activeDocument.saveAs( ai8Doc, saveOptions );

    }

}

exportFileToAI (destFilePath);

 

    alert("Formulário preenchido com sucesso");

How do I save a .DXF file in Illustrator as an AI file using VBscript?

$
0
0

I have a VBA script that opens a .DXF file in Illustrator, and want to save it as an AI file. How do I do this?

an Illustrator error occurred: 1346458189 ('PARM')

$
0
0

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);

}

}

 

 

Screenshot001.png

Viewing all 12845 articles
Browse latest View live


Latest Images