Illustrator Scripting :: Change Color Of Text Frames On Active Layer?
Mar 3, 2013
Okay my script to change text frame color changes the color of all text frames hidden or not.
I need it to only change visible text frames.
if ( app.documents.length > 0 ) {
newCMYKColor = new CMYKColor();
newCMYKColor.black = 0;
newCMYKColor.cyan = 0;
newCMYKColor.magenta = 0;
newCMYKColor.yellow = 0;
[Code]...
How to go about making it only change the color of text frames on the active layer? In the final script I will hide all other layers so if it could be done by a visible attribute more easily that would work just as well.
View 4 Replies
ADVERTISEMENT
Sep 30, 2013
I would like to make the active layer name the same as the document name. I know very little about scripting. I found this script:
var idoc = app.activeDocument;var ilayer = idoc.activeLayer;var filename = idoc.name;ilayer.name = filename;
It does almost what I need it to do. except that it also copies the ".ai" in to the layer name. Is there some way to modify this script to have it exclude or delete the file extension?
View 4 Replies
View Related
Mar 5, 2013
How one would go about ungrouping all groups on an active layer with JavaScript?
View 5 Replies
View Related
Aug 13, 2013
i want to get the swatch color of active document . i use 3 to 4 colors both cmyk and pantone which is in swatches now i want to get their values using script.
View 1 Replies
View Related
Mar 23, 2013
I want to evaluate text frames for their x axis and if they are the same shift them slightly because of adobes irritating habit of combining the text frames when it makes a PDF. I have been able to evaluate, but not exactly like I want to but I know it can be done...
var mydoc = app.activeDocument;var mytext = mydoc.textFrames;var allX_Vaues = new Array();for (i =0; i < mytext.length; i++) {var mytextFrames = mydoc.textFrames[i];var theMatrix = mytextFrames.matrix;allX_Vaues.push(theMatrix.mValueTX)var firstEval = allX_Vaues//$.writeln(theMatrix.mValueA+"
"+theMatrix.mValueB+"
"+theMatrix.mV alueC+"
"+theMatrix.mValueD+"
"+theMatrix.mValueTX+"
"+theMatrix.mV alueTY);//alert(allX_Vaues);}//alert(allX_Vaues[1]);for (i =0; i < allX_Vaues.length; i++) {if (allX_Vaues[i] == allX_Vaues[i + 1] ) {alert(allX_Vaues[i] + " and " + allX_Vaues[i +1] + " are the same");}else{alert(allX_Vaues[i] + " and " + allX_Vaues[i +1] + " are different");} }
[code]....
my problem is when I try to move text frames. It flies way of the page. I just want to move the text a slight amount and concatenate is the only way I have been successful. my question is: Is there a better way and why is my text flying so far of the page?
View 11 Replies
View Related
Oct 17, 2012
I am working on a project which needs..Text frames to be converted as flash text >property changed to dynamic text > writing instance name “_txt”.so how can i write scripting on above process.
View 5 Replies
View Related
Mar 29, 2013
Trying to remove any text frames with empty content but it doesn't seem to be removing correct textFrame layers?
var numberOfEmptyTextBoxes = 0;
var layersWithNoText = new Array();
if ( app.documents.length > 0 ) {
for ( i = 0; i < app.activeDocument.textFrames.length; i++ ) {
[URL] ....
View 3 Replies
View Related
Mar 3, 2013
I want to select all text frames on all visible layers. The script below will select all text frames even in groups but when a layer with text on it is invisible the script will error.(target layer cannot be modified)
if (app.documents.length > 0 ) {
var doc = app.activeDocument;
var numTextFrames = 0;
for ( i = 0; i < doc.textFrames.length; i++ ) {
textArtRange = doc.textFrames[i];
textArtRange.selected = true;
}
}
So I made this script to select text frames on only the visible layers but it now misses text that is in a group.
var layerCount = activeDocument.layers.length;
var docSelected = activeDocument.selection;
for (i = 0; i < layerCount; i++)
[Code] .....
Why it does not selected textframes in a group when done this way and is there a way to get all textframes selected on all visible layers?
View 3 Replies
View Related
Feb 27, 2012
Does this script also cleans up unpainted objects and empty text frames? Personally, I don't think so because the check of the script in extendscript and illustrator results negative.
var idoc = app.activeDocument;var straypoints = []; for (i=0; i<idoc.pathItems.length; i++) {
var ipath = idoc.pathItems[i]; if (ipath.pathPoints.length==1)
straypoints.push(ipath);} for (j=0; j<idoc.textFrames.length; j++) {
var itext = idoc.textFrames[j]; if (itext.textRange.length==0)
straypoints.push(itext);} for (k=0; k<straypoints.length; k++)
straypoints[k].remove();
I also want to automatically remove all objects who have a white fill (white background) and no stroke.
Problem is a created pdf-file of an html-file of a table that must be cleaned up. There are a lot of stray points, empty text frames, unpainted objects, white "cells" that are also be painted in the pdf.
View 1 Replies
View Related
Sep 4, 2012
I've just recently learned how to use scripts to my advantage. I work for a company that uses a lot of custom details using AutoCAD and have now decided to switch them up and use different layers, fonts & styles. So far I have been able to come up with some script changing the styles of how we want the fonts to look, but I am trying to select one font style, change the layer & color of that text, then close the file.
View 4 Replies
View Related
Oct 10, 2013
I am trying to grab specific spot colors and move them to separate layers for our cutting software. In this case I am trying to grab "perimeter cut" and move it to a layer called "tc 1" I get the following error when I try to run the script.
#target Illustrator
var idoc = app.activeDocument;
var ipath = idoc.pathItems;
if (ipath.typename == "SpotColor") {
if (ipath.spot.name == "perimeter cut") {
ipath.move(tc 1, ElementPlacement.PLACEATBEGINNING).
}
}
View 5 Replies
View Related
Feb 6, 2013
I am trying to change the color of all items on and under a specific layer.I have been successful changing the color of specific types of objects (paths), but I need to accommodate all the types on the layer and sub layers.
I can recurse to as many sub layers as I expect, but how do I accommodate the page Items, path Items, group Items, compound Path Items, etc.I was thinking of pushing everything to an array, but I have no experience with arrays...
View 3 Replies
View Related
Apr 3, 2012
For example I would like to make my images layer Green and my copy layer Red in my layers palette.
View 6 Replies
View Related
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
May 4, 2012
I want to overprint a PMS colors using Applescript. I though if I changed the property of the selected items fill color from (fill overprint:false) to (fill overprint:true) it would work. This doesn't seem to change a thing.
This is the script I am currently using:
script ChangeOverprint
tell application "Adobe Illustrator"
local docRef
[Code]....
This is the picture of a simple document I created. The elipse has fill overprint:true. The polygon has filr overprint:false. The original value for the property fill overprint was false. I changed it in the script to true. Which the log shows it changed.
View 1 Replies
View Related
Jun 6, 2012
I am trying to create a script who could act as an Autocad plot (ie convert each color to black, with a different line weight).
Here is the first script I melted, who create my Black swatch
if ( app.documents.length > 0 ) {
var myDoc = app.activeDocument;
//add Black swatch
var newSwatch = app.activeDocument.swatches.add()
var newColor = new GrayColor();
newColor.gray = 100;
[Code] .........
And here is the second one, who replace one color by Black (it don't change the text, nor the lineweight yet…
if ( app.documents.length > 0 ) {
//test de dialogue
function csDialog() {
var fabGroup = app.activeDocument.swatchGroups.getByName('Fabrics');
var allFabs = fabGroup.getAllSwatches();
var fabNames = Array();
[Code] ........
View 2 Replies
View Related
Jan 3, 2013
what is the script to delete some letters from layer?For ex. I've "Layer XYZ" and I want "Layer XY".
View 9 Replies
View Related
Mar 20, 2012
I have a couple thousand AI authored EPS files with a specific swatch name (SpotBlack) that I would like to rename (black) -- is there any method to do this en masse, preferrably outside of Illy using a text editor?
View 7 Replies
View Related
Nov 26, 2012
I need the finished script to create a rectangle with no fill and a 20% gray stroke to outline each artboard. I dug this up off these boards, which works perfectly except the rectangles created have no fill or stroke. certainly save me a lot of time drawing rectangles on a daily basis.
#target illustrator
var docRef = app.activeDocument;
var artboardRef = docRef.artboards;
for(i=0;i<artboardRef.length;i++){
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];
var rect = docRef.pathItems.rectangle (top, left, width, height);
rect.fillColor = rect.strokeColor = new NoColor();
}
View 3 Replies
View Related
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
Mar 6, 2013
When running my script to unlock all layers, so I can select all textFrames and copy them to a new layer, I run into a problem with text that has been locked individually. The script unlocks layers that are lock but it does not unlock items that have been locked individually on those layers. Is there a way to unlock these items?
var layerCount = activeDocument.layers;
for ( j = layerCount.length - 1; j >= 0; j-- )
{
lockedLayers = activeDocument.layers[j];
if (lockedLayers.locked == true && lockedLayers.visible == true)
{
lockedLayers.locked = false;
}
}
View 5 Replies
View Related
Aug 7, 2013
i want to select all the objects in active artboard using javascript
View 5 Replies
View Related
Mar 16, 2014
We need a script that select all pattern objects in the active document in illustrator.
View 5 Replies
View Related
Jun 6, 2013
Is there a way to export a document @ a different resolution than 72DPI? I know I can set the horizontal/vertical scale to save it at a larger dimension at 72DPI, but I need the file to be actual size and 300DPI.
This is part of a larger process, and I'd prefer to do the entire process from Illustrator, and not have to open the files in Photoshop to change the size/resolution.
Also, is it possible to change the color mode to CMYK or Greyscale for the exported Jpeg?
View 7 Replies
View Related
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
View Related
Jan 8, 2014
Somehow I've turned off the color selection so that I don't have a color when I select a part of a drawing on a layer. The drawing area stays black whether I have selected it or not and I don't know how to turn back on the color.
how I can turn on the color again so that when I select a line it changes from black to red or magenta or whatever?
View 3 Replies
View Related
May 19, 2010
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?
View 7 Replies
View Related
Aug 24, 2012
Is there event for change current (active) layer of document?
(it's not Database.ObjectModified - it's not raised).
I tried to do it with binding as:
public void Initialize()
{
var layerList = Application.UIBindings.Collections.Layers;
layerList.PropertyChanged += new PropertyChangedEventHandler(LayerList_PropertyChanged);
And -= in Terminate, but... Autocad 2012 chashed _sometimes_!!!
Impossible to understand when it happened. So I reject this way. Is there other way to handle this event?
View 2 Replies
View Related
Jun 16, 2011
I have created my own graphics from scratch with GIMP, but the resolution to this issue is eluding me.
I imported a GIF map and want to add red labels. I have no problem adding the labels, but I cannot seem to get the text colored red. Before I create the text layer, the text tool shows the color is red, but it still creates it black. All of the suggestions I've seen (yes, I've read the fine manual) reference the same things, including dragging the color from the foreground color (which I've also changed to red). Nothing I've tried seems to work. I've even saved the image as an XCF, but I have the same problem.
View 3 Replies
View Related
Oct 9, 2009
How to globally change text color to by layer in autocad 2008.
View 9 Replies
View Related
Mar 16, 2013
the Script of creating mirror text and stroke text in Adobe illustrator scripting.
View 4 Replies
View Related