Answered
Moving objects with spot color to a new layer javascript
Hello
I have objects with a certain spot color, I need to move them to a new layer
)which does not exist.)
Hello
I have objects with a certain spot color, I need to move them to a new layer
)which does not exist.)
Hey William, this isn't working for me.
The reason seems to be that the stroke is the same color, even though the fills are different...
I'm not sure how to isolate the selection of the stroke so it doesn't pick up the stroke from the fill selection.
How about changing this
doc.selection = null;
doc.defaultFillColor = mySpotSwatch.color;
doc.defaultStrokeColor = mySpotSwatch.color;
//get filled items matching the spot color
app.executeMenuCommand( "Find Fill Color menu item" );
for ( var s = 0; s < doc.selection.length; s++ )
{
doc.selection[ s ].moveToBeginning( myLayer );
}
//get stroked items matching the spot color
doc.selection = null;
app.executeMenuCommand( "Find Stroke Color menu item" );
for ( var s = 0; s < doc.selection.length; s++ )
{
doc.selection[ s ].moveToBeginning( myLayer );
}
doc.selection = null;to this
doc.selection = null;
doc.defaultFillColor = mySpotSwatch.color;
app.executeMenuCommand( "Find Fill Color menu item" );
doc.defaultStrokeColor = mySpotSwatch.color;
app.executeMenuCommand( "Find Stroke Color menu item" );
for ( var s = 0; s < doc.selection.length; s++ ) {
doc.selection[ s ].moveToEnd( myLayer );
}Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.