Skip to main content
tinaz83977757
Participating Frequently
May 14, 2019
Question

Cell color based on content

  • May 14, 2019
  • 1 reply
  • 267 views

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

This topic has been closed for replies.

1 reply

Community Expert
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

-Manan
tinaz83977757
Participating Frequently
May 14, 2019

Hello Manan,

Thanks for fast response.

It's cell style override.

Regards,

Tina

tinaz83977757
Participating Frequently
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.