Create clipping path from current layer's vector- or layermask?
Hi!
I am having a bit of trouble with finding good sources of how to convert the current layer's vector- or layermask into a clipping path via Javascript.
I only found one reference in the scripting reference (apart from the index) - page 139;
| Method | Parameter type | Returns | What it does |
|---|---|---|---|
makeClippingPath ([flatness]) | number [0.2..100] | Makes this the clipping path for this document. flatness tells the PostScript printer how to approximate curves in the path. |
I have tried this to select the Vector Mask;
makeActiveByName("Canvas");
activeDocument.pathItems.getByName('Canvas Vector Mask').select();
But when I add this;
activeDocument.pathItems.getByName('Canvas Vector Mask').makeClippingPath(0.2);
I get this;
I am aware that I should probably convert the Vector mask to a path before creating the clippingpath, but am unable to find relevant info on that issue as well.
TL;DR: How do I create a Clipping path from a Vector- or Layermask through Javascript?
If you can help me closer to the solution of the problem; Thank you!
