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

Find text Tint Value

Guide ,
Apr 04, 2016 Apr 04, 2016

Hi All,

I need to check whether any character have opacity.  I tried the following codings, but it shows all characters as error.

var myframe = app.activeDocument.textFrames; 

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

    var myCharacters = myframe.characters; 

    for(j=0; j<myCharacters.length; j++) 

    { 

         if(myCharacters.opacity != 100) 

         { 

             alert("Error: Check some text has opacity") 

             } 

        } 

    } 

Regards,

Karthi

TOPICS
Scripting
843
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
Adobe
Guide ,
Apr 04, 2016 Apr 04, 2016

Hi Team,

Can i get any suggestions please.

Regards,

Karthi

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 ,
Apr 05, 2016 Apr 05, 2016

Probably, We can’t access characters opacity from script.

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
Guide ,
Apr 05, 2016 Apr 05, 2016

Hi TenA,

Thanks for the prompt response.

Please suggest me, If there is alternate way to get the opacity value of character.

Regards,

Karthi

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
Participant ,
Apr 05, 2016 Apr 05, 2016

Hi Karthi,


Try this

myCharacters.fillColor.tint = val;

Make sure that you are using spot color type for character fill color. It works for me.

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
Guide ,
Apr 05, 2016 Apr 05, 2016

Hi b91823603

I tried

myCharacters.fillColor.tint = val;


but it is not working. More over most of my text is in black color.

var myframe = app.activeDocument.textFrames;

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

{

    var myCharacters = myframe.characters;

    for(j=0; j<myCharacters.length; j++)

    {

        if(myCharacters.fillColor.tint != 100 ) 

        {

            alert("Error: Check some text has opacity")

            }

        }

    }

Is it the way i used is correct?

Regards,

Karthi

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
Participant ,
Apr 05, 2016 Apr 05, 2016

Hi Karthi,

Your code is correct. Check the character color type in illustrator. If it is Spot color then only it will produce result.

Untitled.png

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
Guide ,
Apr 05, 2016 Apr 05, 2016
LATEST

Hi b91823603,

Yes i used Spot colors but it is not working yet. As Ten A said, i don't thing we can find, just a thought.

Regards,

Karthi

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 ,
Apr 05, 2016 Apr 05, 2016

Probably, We can’t access characters opacity from script.

Hi Ten A,

I'm not so much into Illustrator scripting, but just inspected the Illustrator ExtendScript DOM where I found some properties for transparency and opacity for the TextPath Object.

Example:

myTextPath.blendingMode = BlendModes.NORMAL;

myTextPath.opacity = 50;

For individual characters there is no property opacity, but for the whole textPath there is.
I looked it up in Jongware's excellent Adobe Illustrator CS6 Object Reference here:

Indesign JavaScript Help

Uwe

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 ,
Apr 05, 2016 Apr 05, 2016

We can set characters opacity manually, But, we can’t check characters opacity from script.

In case like below, I was set characters[1](b)’s opacity as 50%.

スクリーンショット 2016-04-05 18.52.55.png

Check parent textFrame properties using Property Explorer:

スクリーンショット 2016-04-05 18.53.23.png

We got 100% of textFrames opacity. So we can’t check characters opacity from script.

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