Copy link to clipboard
Copied
How do I apply an existing path as a vector mask to an existing layer or a new solid color layer?
Saying that... how do I do that manually?
Thanks!
Saying that... how do I do that manually?
If you have a non-background layer as active then you can select the path and go menubar/layer/vector mask/current path… done…
You can do the same with script like so…
#target photoshop var doc = app.activeDocument; doc.pathItems.getByName('Work Path').select(); pathtoVectorMask(); doc.pathItems.getByName('Work Path').remove(); function pathtoVectorMask() { function cTID(s) { return app.charIDToTypeID(s); }; function sTID(s) { return app.stri
...Copy link to clipboard
Copied
Saying that... how do I do that manually?
If you have a non-background layer as active then you can select the path and go menubar/layer/vector mask/current path… done…
You can do the same with script like so…
#target photoshop var doc = app.activeDocument; doc.pathItems.getByName('Work Path').select(); pathtoVectorMask(); doc.pathItems.getByName('Work Path').remove(); function pathtoVectorMask() { function cTID(s) { return app.charIDToTypeID(s); }; function sTID(s) { return app.stringIDToTypeID(s); }; var desc27 = new ActionDescriptor(); var ref11 = new ActionReference(); ref11.putClass( cTID('Path') ); desc27.putReference( cTID('null'), ref11 ); var ref12 = new ActionReference(); ref12.putEnumerated( cTID('Path'), cTID('Path'), sTID('vectorMask') ); desc27.putReference( cTID('At '), ref12 ); var ref13 = new ActionReference(); ref13.putEnumerated( cTID('Path'), cTID('Ordn'), cTID('Trgt') ); desc27.putReference( cTID('Usng'), ref13 ); executeAction( cTID('Mk '), desc27, DialogModes.NO ); };
The above assumes… 1. you have a document open… 2. your active layer is NOT background 3. you have a path called 'Work Path'… there may be some other checks that you should make too…
Copy link to clipboard
Copied
Sweeeet! Exactly what I was looking for. Dunno why I couldn't find it. Thanks!
Copy link to clipboard
Copied
The only thing the script does different is I removed the original path after its duped to a layers vector mask…
Find more inspiration, events, and resources on the new Adobe Community
Explore Now