Illustrator Scripting :: Changing Selected Text Color With JavaScript

Feb 25, 2013

I want to change my selected text to a different cmyk color using javascript. I have tried and I do not know what is missing or what I am doing wrong.
 
if ( app.documents.length > 0 ) {
newCMYKColor = new CMYKColor();
newCMYKColor.black = 0;

[Code]...

View 4 Replies


ADVERTISEMENT

Illustrator Scripting :: Changing Text From Helvetica To Arial With JavaScript

Mar 11, 2013

I’m working with PDF files in illustrator and whenever the file uses Helvetica I have to change the font to Arial. This gets old when working with hundreds of illustrations. How I would go about changing all text that uses Helvetica bold to Arial bold and Helvetica Roman to Arial?
 
Would I loop through all the text frames and get the value of the font and use that value to change them or is there a more global way to go about this?

View 15 Replies View Related

Illustrator Scripting :: Export Selected Artboards PNG24 JavaScript?

Mar 1, 2013

I'm trying to do some workflow enhancements. For our games we need to export to PNG at different resolutions for different mobile devices. I use a artboard per asset and currently manually export 3 times (using file/export/png with use artboards option), at 72 dpi, 144 dpi and 33.75 dpi.
 
I've been modifying a simple Javascript I downlaoded and have got it save to different fixed locations at different scales. All good. However exporting every artboard each time will cause issues with our version control system and take too long. It's not really a solution.
 
So I need a way to either only export the current selected artboards (which I believe can't be done) or somewho show the artboard range dialog that the system uses. Either of those would be a good solution.
 
var docRef = app.activeDocument;
var num_artboards = docRef.artboards.length;
var getName = app.activeDocument.name;
var fileName = getName.slice(0, -3);
[code]...

View 7 Replies View Related

Illustrator Scripting :: JavaScript To Send Selected TextFrame To Current Layer?

Feb 20, 2013

Is there a way to send a selected textFrame item to a layer using javascript?
 
I don't mind if it is send to current layer or some other way to accomplish the task.
 
(Using Adobe Illustrator CS4)

View 5 Replies View Related

Illustrator :: Changing Color Of Selected Portions Of Text?

Feb 10, 2013

How can I take some text and select different parts of the text to change the color for the selected parts?

View 5 Replies View Related

Illustrator Scripting :: Color Change Command In JavaScript

Feb 4, 2013

I managed to write this javascript. It automatically changes the colors from one swatch (byName) to another (byName) in my opened illustrator file. But if this one color doesn't exist as a fill or outline color in a file, I get an error message, because the script can not detect the color. The script stops. I am working on a batch of Illustrator files with 3 colors to change, but some files contain just 1 or 2 of the colors.Is there a command for javascript which says: "Only change the color, if the color appears"?

Here is the script:
 
var docRef = app.activeDocument;
with (docRef) {
var findColor = swatches.getByName('TSB Dark Blue').color;
var replaceColor = swatches.getByName('TSBDB').color;
[code]....

View 2 Replies View Related

Illustrator Scripting :: How To Tell With JavaScript That The Text Was Set To Overprint

Feb 24, 2012

If I were to select some text, then checkmark 'Overprint Fill' in the 'Attributes' pane, is there a way to tell with JavaScript that the text was set to overprint?
 
I've been experimenting with this code in ExtendScript, but it keeps returning false:
 
var doc = app.activeDocument;
$.write(doc.textFrames[0].textPath.fillOverprint + '
');

View 3 Replies View Related

Illustrator Scripting :: Color Value Of Spot Colors Cannot Be Adjusted Via JavaScript?

Jul 17, 2012

color value of spot colors cannot be adjusted via javascript?

View 5 Replies View Related

Illustrator Scripting :: Adding Spot Color Using JavaScript - TRY CATCH Not Working

Mar 6, 2014

I am trying to add spot color in illustrator using javascript, TRY CATCH is not woking, it is adding again and again same color value with name of "spot color 1" and "spot color 2" ... 
 
try {
var myDoc = app.activeDocument;
var spotName = "FINISHING";
var spot = myDoc.spots.add();
 
[Code] .......

View 1 Replies View Related

Illustrator Scripting :: Creating Outlines From Text Using JavaScript In CS5?

Feb 18, 2012

Is there a way to select all of the text on all artboards and CREATE OUTLINES using Javascript? The text that Adobe provides for scripting has this option for saving to FXGs which is preserveTextPolicy or something similar, but I need the same type of solution for saving as an AI file or as a command before the save. I'm currently working in windows, but am writing this script for use on a MAC. If there isn't an internal way of doing this through Javascript?  I would imagine it would be possible through Applescript since it can access the application's GUI, but I'm not sure. A javascript solution would be preferable, but any solution would work at this point.

View 7 Replies View Related

Illustrator Scripting :: Splitting Up Stacked Text With JavaScript

Mar 14, 2013

I am trying to get any stacked text in my illustrator file that is a single frames  such as with carriage returns such as:
 
1
2
3
4
5
 
to be individual text frames.
 
Is there a split command I can use?
 
Im thinking it would start by finding all the textframes that have carriage returns is the carriage return identified as " "

View 5 Replies View Related

Illustrator Scripting :: How To Set Color For Each Selected Object Via Eyedropper

May 30, 2013

When I run the script for an object selection, I want each object to have its color set to the underlying color as if I had used the eyedropper tool.  Is this something that can be scripted?

View 1 Replies View Related

Illustrator Scripting :: CS5 - Change Fill Color Of Selected Path Items

Apr 2, 2013

I'm trying to create a script in CS5 mac os10.6.8 that will change the fill color of selected pathItems. I need a simple script that will change a selected pathItem to cmyk values 2,3,15,0. I will then select this script and implement the action in a batch of 600 files.
 
I wish this process could be recorded as an action but when I record the action "add new swatch" I have to manually input the cmyk values, which will take forever for a batch of over 600 files.

View 15 Replies View Related

Illustrator Scripting :: How To Determine The Size Of Selected Text

Sep 6, 2012

I'd like to draw a box around some selected text (a textRange), however I can't figure out how to detemine the size or position of the text.  The overall size of a textFrame is possible to find (not sure about position), but when you've got just a few characters selected I don't see any way to get the size or position. 

View 6 Replies View Related

Illustrator Scripting :: Changing Color Of A Selection To HEX

Sep 6, 2012

I'm new to illustrator scripting (but not to javascript or programming. I have an AI file that has multiple layers. each layer has several items that are supposed to be of same color. I have an array of HEX values.

I would like to loop over all items in a single layer, select them and change their color to some given HEX. Once that works, I will run on all HEX entries in array and save each variation in a separate PNG file.
 
For the first part i wrote some script (see below), but i do not see any change in the file after i run the script. No errors and no change. I run the script once i select all items in a specific layer.
 
My code:

function hexToRgb(hex) {
    var result = /^#?([a-fd]{2})([a-fd]{2})([a-fd]{2})$/i.exec(hex);
    return result ? {
        r: parseInt(result[1], 16),
        g: parseInt(result[2], 16),
        b: parseInt(result[3], 16)

[Code] ......

View 3 Replies View Related

Illustrator :: Changing Color Of Lines That Identify Selected Objects

Jun 18, 2013

Some of my artboards use the color yellow to highlight selected objects. Can I change that?

View 2 Replies View Related

Illustrator Scripting :: Changing Opacity Of Text?

Nov 25, 2013

I'm trying to change/access the opacity of a text object (Illustrator CC). In the documents, I found that it's represented by a text frame object, but it doesn't have opacity property. Text range and character attributes don't have it either, so I'm wondering: is there any way of accessing/altering the opacity of a text object using Javascript?

View 5 Replies View Related

Illustrator Scripting :: Changing Line Of Text In Multiple AI Files

Apr 5, 2013

I have about 500 files that I need to change one line of text in. Example. File name is XXX 001, the line of text is the file name so it would read XXX 001. XXX 002... etc. up to XXX 500. Is there a way that I could automate it opening, changing this line of text, saving and closing?

View 1 Replies View Related

Illustrator Scripting :: Call Actions Through JavaScript

May 2, 2012

Currently i'm doing automations for Adobe Illustrator CS4. I have created some actions due to the limitations of scripting in Illustrator. I need to call this actions through javascript.But in applescript i can able to call the actions by using the do script method.

View 5 Replies View Related

Illustrator Scripting :: Convert JavaScript To AppleScript?

Apr 3, 2012

I need to convert javascript to Apple script.
 
try {
app.activeDocument.layers.getByName( '.ARD' ).remove(); } catch (e) {};

View 1 Replies View Related

Illustrator Scripting :: Set Stroke Alignment From JavaScript

Jan 21, 2013

I'm trying to set the stroke style for a path item I've drawn through JavaScript, however I can't find a way to set the stroke alignment for my path item.

I've checked the Illustrator JavaScript reference but I can't seem to find that option in there.I would expect something like:
 
pathItem.strokeAlignment = StrokeAlignment.OUTSIDE; // This doesn't work, what is the correct way to set the stroke alignment from JavaScript?
 
If I change the option in the Actions Panel it comes up as 'Set Stroke/Alignment: Outside', so there must be an equivalent way of setting it from JavaScript. Is there a way of converting Actions to JavaScript so you can see which properties and attributes are being set on the object? What is the correct way to set the strok alignment from JavaScript?

View 5 Replies View Related

Illustrator Scripting :: How To Add Spotcolor To Colorgroup In JavaScript

Feb 11, 2012

How to add a spotcolor to a colorgroup in javascript?

View 1 Replies View Related

Illustrator Scripting :: Execute Action From JavaScript In CS6

Jul 10, 2013

I've seen on this forum a lot people saying that in CS6 you can now call an action from JavaScript. However, I haven't been able to find what the syntax is to do that in the reference or the guide. Can you actually do this now with Javascript?

View 2 Replies View Related

Illustrator Scripting :: Link To Webpage From AI JavaScript?

Dec 5, 2012

I've written a script with a ScriptUI interface, which other people will be using. I'd like to include a 'help' button in the interface, which ideally would connect to a web page with more details. (The alternative is to create the 'help' window in javascript, but the web page already exists and it would be a shame not to use it.)
 
From what I've read, other Creative Suite programs may be able to connect to the web with javascript, but apparently not Illustrator.

View 22 Replies View Related

Illustrator Scripting :: Create Files With JavaScript?

May 5, 2012

I would like make a config file for my script that i would like to put in the %appdata%adobe folder.
 
How can i reah the value of %appdata% inside javascript?How do i create and read files? 

I am currently reading the Extendscript javascript toolsguide but i cant figure out how to create a file:
 
Should not this code create a file in C: directory?
 
Fille = new File('C: est.txt');
Fille.write("Testwriting!");
Fille.close();

View 10 Replies View Related

Illustrator Scripting :: Create A Panel With JavaScript?

Jan 26, 2013

As I´m studying JavaScript and the user interface creation...would like to ask (more for curiosity):
 
Is it possible to create a new panel for Illustrator using JavaScript? Or this is only possible using C++?
 
(in the Window Class UI we have the "palette" creation method..so wondering the result of it too)

View 10 Replies View Related

Illustrator Scripting :: Importing Data With JavaScript

Feb 3, 2014

I would like to open a file dialog box seltect a CSV text file saved from Excel and import this into an array/variable/dataset in adobe illustrator using javascript. Have done some work with javascript but not a power user. Can't work out how to get the open dialog to appear.

Long term aim would be to use the data to plot a path which seems straighwforward enough, its the getting the info in bit I'm stuck on.

You do have to be able to select the file to import, this bit quite important.

View 2 Replies View Related

Illustrator Scripting :: Duplicating A Circle With JavaScript

Jan 9, 2013

I'm trying to build something like a bullseye using javascript. I'm new to scripting for Illustrator but I've used javascript before so I thought it would be simple, but maybe I'm missing some basic notions here.
 
I'm using Illustrator CS6. I created a blank document and drew a circle with a 1pt black stroke and no fill. Selecting that circle, I my script to copy and paste it in front and increase its radius by one centimeter. I attempted a simple duplication first:
 
if ( app.documents.length > 0 ) {
var numberOfItems = 3;
var selectedItem = app.activeDocument.selection;
for (i=0; i < numberOfItems; i++) {
newItem = selectedItem.duplicate();
}
}

With my circle selected I get an error message saying "Error 24: selectedItem.duplicate() is not a function".

View 7 Replies View Related

Illustrator Scripting :: Select Objects Outside Artboard Using JavaScript

Aug 10, 2013

I want to select the objects outside artboard using javascript. Their are many objects outside activeartboard i want to select all those object using script.

View 1 Replies View Related

Illustrator Scripting :: Possible To Apply Transform Effect From JavaScript?

Apr 18, 2013

I was wondering if it's possible to do what Effect > Distort & Transform > Transform does from JS. I had a look at the documentation and found nothing in that direction.
 
The closest thing I found was PageItem.applyEffect(effectXML) looking at the Object Model Viewer in Extend Script Toolkit, but couldn't find documentation for it and I suspect it might have something to do with SVG filters perhaps ?
 
In conclusion: Is it possible to apply a Transform effect from JS (and if so, how )?How can applyEffect be used ? 

View 4 Replies View Related

Illustrator Scripting :: Variable Width Tool (JavaScript)

Feb 6, 2013

I am looking for any info on scripting the Variable width tool (Javascript).
 
Background: By adding a gradient to a variable width strock you can create nice 3D looking  Shapes (see example)

this is a straight vertical line with varied widths, then hit with a gradient.
 
Goal: My hope is to write a script that will take a "Profile" or "Shape" and convert it to a Variable width line. (see Example)

The Black line is to have its widths modified
The Red line is how wide the line needs to be.

View 10 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved