Skip to main content
Inspiring
May 6, 2022
Answered

Which attribute defines the transparency of an object?

  • May 6, 2022
  • 3 replies
  • 763 views

HI, Which attribute defines the transparency of an object? I want to find out from a large number of objects that use transparency...

This topic has been closed for replies.
Correct answer pixxxelschubser

Which objects?

PathItems?

In Groups or CompoundPaths Or in Selections or in Layers/Sublayers/Document?

Fill color opacity? Or Stroke color opacity? Or Opacity in multiple colors/strokes?

In Gradients?

 

Unfortunately, not everything can be accessed with scripting!

 

For the beginning:

// select (only) one pathItem before running this snippet
var aSel = app.activeDocument.selection[0];
if (aSel.typename == "PathItem" && aSel.opacity < 100) alert(aSel.opacity);

3 replies

pixxxelschubser
Community Expert
pixxxelschubserCommunity ExpertCorrect answer
Community Expert
May 6, 2022

Which objects?

PathItems?

In Groups or CompoundPaths Or in Selections or in Layers/Sublayers/Document?

Fill color opacity? Or Stroke color opacity? Or Opacity in multiple colors/strokes?

In Gradients?

 

Unfortunately, not everything can be accessed with scripting!

 

For the beginning:

// select (only) one pathItem before running this snippet
var aSel = app.activeDocument.selection[0];
if (aSel.typename == "PathItem" && aSel.opacity < 100) alert(aSel.opacity);
Inspiring
May 7, 2022

It's pageItems in document.

I want to find all objects with opacity applied (< 100), regardless of what it is, pathItems,groupItems,text or others pageItems can....

 

// select (only) one pathItem before running this snippet
var aSel = app.activeDocument.selection[0];
if (aSel.typename == "PathItem" && aSel.opacity < 100) alert(aSel.opacity);

 

This is really a good beginning:  

aSel.opacity<100

 

Thank you.

CarlosCanto
Community Expert
Community Expert
May 6, 2022

opacity?

 

can you elaborate?

Inspiring
May 7, 2022

Hi Carlos,

 

Yes, it is opacity (<100)

 

I want to find all objects with opacity applied (< 100), regardless of what it is, pathItems,groupItems,text or others pageItems can....

 

 

 

Monika Gause
Community Expert
Community Expert
May 6, 2022

Independent of scripting this ...

Transparency can be applied to

- the object altogether: opacity and/or blend mode and/or pixel based effects

- the fill (there can be multiple)

- the stroke (there can be multiple)

- if there is a gradient applied, the gradient stops can have opacity settings

- in patterns the elements inside the pattern can have opacity/blend modes

- same goes for brushes

- while the stroke width is zero, the brush can still be applied to the object

- there can be an opacity mask applied

- transparency can also be applied to the group or layer the object is a part of

Inspiring
May 7, 2022

Thank you for your further reply!

I want to find all objects with opacity applied (< 100), regardless of what it is, pathItems,groupItems,text or others pageItems can....