convertPathtoShape.jsx 766 B

1234567891011121314151617
  1. convertPathtoShape();
  2. function convertPathtoShape() {
  3. var d = new ActionDescriptor();
  4. var d2 = new ActionDescriptor();
  5. var d3 = new ActionDescriptor();
  6. var d4 = new ActionDescriptor();
  7. var r = new ActionReference();
  8. r.putClass( stringIDToTypeID( "contentLayer" ));
  9. d.putReference( charIDToTypeID( "null" ), r );
  10. d4.putDouble( charIDToTypeID( "Rd " ), 255);
  11. d4.putDouble( charIDToTypeID( "Grn " ), 255);
  12. d4.putDouble( charIDToTypeID( "Bl " ), 255);
  13. d3.putObject( charIDToTypeID( "Clr " ), charIDToTypeID( "RGBC" ), d4 );
  14. d2.putObject( charIDToTypeID( "Type" ), stringIDToTypeID( "solidColorLayer" ), d3 );
  15. d.putObject( charIDToTypeID( "Usng" ), stringIDToTypeID( "contentLayer" ), d2 );
  16. executeAction( charIDToTypeID( "Mk " ), d, DialogModes.NO );
  17. }