Copiar vínculo al Portapapeles
Copiado
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
Copiar vínculo al Portapapeles
Copiado
Hi Team,
Can i get any suggestions please.
Regards,
Karthi
Copiar vínculo al Portapapeles
Copiado
Probably, We can’t access characters opacity from script.
Copiar vínculo al Portapapeles
Copiado
Hi TenA,
Thanks for the prompt response.
Please suggest me, If there is alternate way to get the opacity value of character.
Regards,
Karthi
Copiar vínculo al Portapapeles
Copiado
Hi Karthi,
Try this
myCharacters
Make sure that you are using spot color type for character fill color. It works for me.
Copiar vínculo al Portapapeles
Copiado
Hi b91823603
I tried
myCharacters
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
Copiar vínculo al Portapapeles
Copiado
Hi Karthi,
Your code is correct. Check the character color type in illustrator. If it is Spot color then only it will produce result.
Copiar vínculo al Portapapeles
Copiado
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
Copiar vínculo al Portapapeles
Copiado
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:
Uwe
Copiar vínculo al Portapapeles
Copiado
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%.
Check parent textFrame properties using Property Explorer:
We got 100% of textFrames opacity. So we can’t check characters opacity from script.
Encuentra más inspiración, eventos y recursos en la nueva comunidad de Adobe
Explorar ahora