Copy link to clipboard
Copied
there's a way for both extremely complicated topics
1. check if an object has an Opacity Mask
2. transform object with Opacity Mask
1. check for Opacity Mask as described in this post by @m1b
2. turn object with Opacity Mask into a Symbol, transform as usual, remove Symbol...take that chatGPT!
// rotate or move Object with Opacity Mask
// Carlos Canto - 8/10/2025
// sele
...
Copy link to clipboard
Copied
I know only one solution, and it's not the most pleasant one. This is to generate an action inside the script with the rotation angle parameter and apply it to the selected object via app.doScript(), then unload the action. This complicates scripts, so I rarely use this workaround. Unless it is critically important to consider the possible presence of an Opacity Mask in the file. Since objects don't have any Boolean properties to check for Opacity Mask, although we can check for clipped groups.
For example, to duplicate a print on a series of T-shirts, the designer said that he uses an Opacity Mask. Then I made an action generation inside the script with the Move command, where the calculated X, Y delta of the duplicate movement were added.
Copy link to clipboard
Copied
there's a way for both extremely complicated topics
1. check if an object has an Opacity Mask
2. transform object with Opacity Mask
1. check for Opacity Mask as described in this post by @m1b
2. turn object with Opacity Mask into a Symbol, transform as usual, remove Symbol...take that chatGPT!
// rotate or move Object with Opacity Mask
// Carlos Canto - 8/10/2025
// select a single object with Opacity Mask before running
function main() {
var idoc = app.activeDocument;
var sel = idoc.selection[0];
var newSymbol = idoc.symbols.add(sel, SymbolRegistrationPoint.SYMBOLCENTERPOINT);
instance = idoc.symbolItems.add(newSymbol);
instance.position = sel.position;
selection = null;
instance.rotate(45);
//instance.translate (instance.width);
instance.breakLink(); // returns the original compound path inside a layer
newSymbol.remove();
var dup = selection[0];
var parent = dup.parent; // this is the layer that needs to be removed
dup.move (sel, ElementPlacement.PLACEBEFORE);
parent.remove();
sel.hidden = true; // hide for now, it could be removed if not needed
}
main()
Copy link to clipboard
Copied
Awesome, Thanks!. Adobe Scripting; sometimes the solution’s simple, and other times people go on wild adventures just to fix something that feels like it should’ve been there all along.
Copy link to clipboard
Copied
on a slight tangent but, where do you find stuff like "breakLink()" is there a list somewhere of these undocumented methods?
Copy link to clipboard
Copied
breakLink() is not in the official Javascript Reference but it is sort of documented. It's in the Object Model and it also shows up in VSCode autocomplete Types-For-Adobe
Copy link to clipboard
Copied
Thanks
Find more inspiration, events, and resources on the new Adobe Community
Explore Now