Hello,
Our preproduction team are having issues with different blacks in a file before print. We want to be able to run a macro that can go through a file and change all 100% black objects/ outlines etc from C:100 M:100 Y:100 L:100 to C:0 M:0 Y:0 K:100.
Is this something to record myself or does it need a written script?
Use this and tweak the code as needed. We don't print anything with just 100% black. We had used the C45 M45 Y45 K100 as seen in the code but have since switched to using R0 G0 B0. Richer black and smaller file sizes for the print RIP.
Sub ConvertBlacks()ActiveDocument.BeginCommandGroup "ConvertBlacks" Dim sr As ShapeRange Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=0 and .m=0 and .y=0 and .k=100]") sr.AddToSelection sr.ApplyUniformFill CreateRGBColor(0, 0, 0) Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=45 and .m=45 and .y=45 and .k=100]") sr.AddToSelection sr.ApplyUniformFill CreateRGBColor(0, 0, 0) Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=100 and .m=100 and .y=100 and .k=100]") sr.AddToSelection sr.ApplyUniformFill CreateRGBColor(0, 0, 0) Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=75 and .m=68 and .y=65 and .k=90]") sr.AddToSelection sr.ApplyUniformFill CreateRGBColor(0, 0, 0) ActiveSelectionRange.RemoveFromSelection Set sr = ActivePage.Shapes.FindShapes(Query:="@outline.color.cmyk[.c=45 and .m=45 and .y=45 and .k=100]") sr.AddToSelection sr.SetOutlineProperties , OutlineStyles(0), CreateRGBColor(0, 0, 0) ActiveSelectionRange.RemoveFromSelection Set sr = ActivePage.Shapes.FindShapes(Query:="@outline.color.cmyk[.c=0 and .m=0 and .y=0 and .k=100]") sr.AddToSelection sr.SetOutlineProperties , OutlineStyles(0), CreateRGBColor(0, 0, 0) sr.AddToSelection Set sr = ActivePage.Shapes.FindShapes(Query:="@outline.color.cmyk[.c=75 and .m=68 and .y=65 and .k=90]") sr.AddToSelection sr.SetOutlineProperties , OutlineStyles(0), CreateRGBColor(0, 0, 0) Set sr = ActivePage.Shapes.FindShapes(Query:="@outline.color.cmyk[.c=100 and .m=100 and .y=100 and .k=100]") sr.AddToSelection sr.SetOutlineProperties , OutlineStyles(0), CreateRGBColor(0, 0, 0) ActiveSelectionRange.RemoveFromSelection ActiveDocument.EndCommandGroupEnd Sub
Myron said:Set sr = ActivePage.Shapes.FindShapes(Query:="@outline.color.cmyk[.c=75 and .m=68 and .y=65 and .k=90]")
Please don't mind me asking...Why did you put sr.AddToSelection before this line? Shouldn't it be ActiveSelectionRange.RemoveFromSelection ?I'm trying to understand your code: every time there's a FindShapes and then sr.ApplyUniformFill. I just don't understand why you use sr.AddToSelection and sometimes ActiveSelectionRange.RemoveFromSelection. Or does this selection prevent finding earlier found shapes again?Wouldn't this be simpler? :Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=100 and .m=100 and .y=100 and .k=100]")sr.ApplyUniformFill CreateRGBColor(0, 0, 0)Set sr = ActivePage.Shapes.FindShapes(Query:="@fill.color.cmyk[.c=45 and .m=45 and .y=45 and .k=100]")sr.ApplyUniformFill CreateRGBColor(0, 0, 0)o
Because I'm not a true "coder" I'm more of a hack. I put together codes from others etc. If it doesn't work the way I'm wanting I just keep hacking until I get it. Yes, there are much simpler ways. I appreciate you pointing that out.