Copy link to clipboard
Copied
I need your help. I am new to write the javascript. I need to select the white text with overprint enabled (White means: C=0, M=0, Y=0, K=0).
I am writing the script but I don't it is not working properly. kindly highlight my error or advice me.
Reference script below:
#target illustrator-21
function fillColorOp(){
var doc = app.activeDocument;
doc.selection = null;
for(var i=0; i < doc.textFrames.length; i++)
var thisTf = doc.textFrames;
{
for ( var j = 0; j < thisTf.textRanges.length; j++ )
var thisTr = thisTf.textRanges
{
if(thisTr.characterAttributes.fillColor &&
(Math.round(thisTr.characterAttributes.fillColor.cyan) == 0) &&
(Math.round(thisTr.characterAttributes.fillColor.magenta) == 0) &&
(Math.round(thisTr.characterAttributes.fillColor.yellow) == 0) &&
(Math.round(thisTr.characterAttributes.fillColor.black) == 0) && (thisTr.characterAttributes.fillOverprint))
{
thisTr.selected = true;
};
};
};
};
fillColorOp();
Thanks in advance
Kalaimani.S
Salut Kalaimani
Strictement ce que tu as demandé,
...// JavaScript Document
#target illustrator
function fillColorOp(){
var thisTf, color;
var doc = app.activeDocument;
doc.selection = null;
for (var i = 0; i < doc.textFrames.length; i++) {
thisTf = doc.textFrames;
color = thisTf.textRange.characterAttributes.fillColor;
if (thisTf.textRange.characterAttributes.overprintFill) {
if(!color.cyan && !color.magenta && !color.yellow && !color.black) {
Copy link to clipboard
Copied
Salut Kalaimani
Strictement ce que tu as demandé,
// JavaScript Document
#target illustrator
function fillColorOp(){
var thisTf, color;
var doc = app.activeDocument;
doc.selection = null;
for (var i = 0; i < doc.textFrames.length; i++) {
thisTf = doc.textFrames;
color = thisTf.textRange.characterAttributes.fillColor;
if (thisTf.textRange.characterAttributes.overprintFill) {
if(!color.cyan && !color.magenta && !color.yellow && !color.black) {
thisTf.selected = true;
}
}
}
}
fillColorOp();
de elleere
Copy link to clipboard
Copied
It is working good on fill color text but is not working with the appearance...Thanks a lot.
Copy link to clipboard
Copied
Hi... kalaimanis71535121, I asked you here... Preflight Pre-Press
What did you mean by appearance?
Copy link to clipboard
Copied
My guess is similar to this, however we need that clarified as I may be wrong:
P.S. Kudos for your work in that other linked topic!
Copy link to clipboard
Copied
We are filled are stroked it appears on appearance palate. Snapshot for your reference.
(Note: hight lighted color is white).
Test file has attached: https://drive.google.com/open?id=1LFJEkjDTFRtI7C8LdYvZr58jpOa4Zgxm
Thanks and regards.
Kalaimani.s
Copy link to clipboard
Copied
For me, the obvious addition would be:
thisTf.textRange.characterAttributes.overprintFill = false
However text with white overprinting strokes and vector paths with strokes or fills that were overprinting white would also benefit from the same treatment...
EDIT: Ah, that other linked topic answers those questions… Fantastic stuff!!!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now