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

Cell color based on content

New Here ,
May 14, 2019 May 14, 2019

Hi guys,

I know this has been much discussed topic.

I tried with different scripts for applying cell style, however clear overrides does not work for me.

One of the scripts is here:

var myDoc = app.activeDocument

app.findTextPreferences = app.changeTextPreferences = null

app.findTextPreferences.findWhat = "sometext"

app.findTextPreferences.appliedParagraphStyle = "style1";

var myFound = myDoc.findText()

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

{

    if(myFound.parent.constructor.name == "Cell")

    {

    myFound.parent.appliedCellStyle = "grey"

     var overrides = myFound.clearOverrides();          //this is the new line added in this content

Thanks in advance for any help,

Tina

TOPICS
Scripting
253
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
Community Expert ,
May 14, 2019 May 14, 2019

Hi Tina,

Which override are you talking about cell style, character style or paragraph style override. Can you share a sample document on which we can see the issue happening.

-Manan

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
New Here ,
May 14, 2019 May 14, 2019

Hello Manan,

Thanks for fast response.

It's cell style override.

Regards,

Tina

cellColor.jpg

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
New Here ,
May 14, 2019 May 14, 2019

Hi Manan,

I think I found the problem. If I write or copy text into cells, then the script works.

But if I import it from Excel, then it obviously stops at override.

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
New Here ,
May 14, 2019 May 14, 2019
LATEST

Hi Manan,

I'm sending you files.

When I make new table, then the script works. But when I delete contents

and try to reuse the same, then it is stuck.

Best,

Tina

On Tue, May 14, 2019 at 11:01 AM Manan Joshi <forums_noreply@adobe.com>

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