Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Deleting text frames without a specific fill color

Engaged ,
Oct 14, 2014 Oct 14, 2014

I was wondering if someone might be able to tell me a simple way in javascript to scan through all the text frame in my active document that are NOT filled with the following RGB values...

fillColor.red = 11

fillColor.green = 142

fillColor.blue = 196

Windows 7 64 bit, CS4

TOPICS
Scripting
359
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Oct 15, 2014 Oct 15, 2014

I changed my concept to make it more dynamic for my purpose. I am checking to see if the fillColor typename is RGBColor or GrayColor. I am deleting anything that is GrayColor. Thought I would share the code for the community to use as you wish. Hope it helps somebody!

var doc = app.activeDocument

var allText = doc.textFrames;

var readFillColor = [];

for(i=0; i<allText.length; i++)

{

  textItemsRange = allText.textRange;

  readFillColor = textItemsRange.characterAttributes.fillColor

  if(readFillColor.ty

...
Translate
Adobe
Engaged ,
Oct 15, 2014 Oct 15, 2014
LATEST

I changed my concept to make it more dynamic for my purpose. I am checking to see if the fillColor typename is RGBColor or GrayColor. I am deleting anything that is GrayColor. Thought I would share the code for the community to use as you wish. Hope it helps somebody!

var doc = app.activeDocument

var allText = doc.textFrames;

var readFillColor = [];

for(i=0; i<allText.length; i++)

{

  textItemsRange = allText.textRange;

  readFillColor = textItemsRange.characterAttributes.fillColor

  if(readFillColor.typename == "RGBColor")

  {

  //alert("Found RGBColor")

  }

else{

  //alert("Found GrayColor")

  textItemsRange.remove();

  }

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines