Accessing Opacity Mask is impossible with scripting
There is no way to work with the transparency mask in the Script SDK. This is the least of the problems. But when creating scripts to modify objects with masks, developers expect masks to be modified along with the parent object. After all, we see the "Linked to Art" icon in the Transparency panel.
But what we have all these years as script developers: resize(), position, translate() modify the object, and its mask remains as it was.
I've counted about 10 of my own scripts that use similar commands. I also have a large collection of other developers' scripts, where about 70 scripts contain similar commands. So none of them will help users automate operations with their art.
More than once I've had users come to me and ask, "Where did the opacity mask go after I ran the script? The only solution is to add dynamic actions with Move, Scale with calling app.doScript(). But this introduces many other problems and inconveniences.
-
Anonymous commented
+1 should be fixed
-
Sergey Osokin commented
Of course, there are similar problems when using resize(), rotate() methods, when the object is scaled or rotated, but its transparency mask remains unchanged.
-
dean commented
Transparency / Opacity Mask - In layers pallet page item names look different with masks (underline) and opacity masks (dashed). It would be great if you could add this to properties of the page item like mask: none, opacity mask or mask. Identifying these objects is even harder then Envelopes which can only be identified by identifying as plugin object. Worst case putting info in the tag propery would be better then nothing when cresating it. I do not believe a opacity mask can be identified through any form of SDK/Script which makes identifying raster images in the file impossible. The other option would be to have the raster item still listed when it is part of opacity mask. Also on this site an option should be all so that not SDK/Script specific.