Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Script to set fill and overprint of all images in named layer?

Return to Member Forum

  • Author
    Posts
    • #93780
      Jorge –
      Member

      Hi,

      I am not familiar with InDesign scripting and I would appreciate if someone could hack one for me.

      I have a bunch of CMYK separated 1-bit TIFF images (4 per page), and I am trying to reassemble them into a composite InDesign layout. I already have them all placed in InDesign, each separation into its respective layer, them named “C”, “M”, “Y”, “K” (arranged in that order, with “C” at the bottom).

      Next would be to direct select each image, assign their respective fill swatch from cyan, magenta or yellow (default fill is “[Black]” so images in layer “K” are fine as they are) and set their “overprint” attribute to on (menu Window > Output > Attributes).

      Doing so manually for each page is tedious. What would a script that would do something like “Set the fill for all images of all pages on layer ā€˜C’ to swatch cyan and activate their overprint attribute. Repeat accordingly for all other layers with their respective fill” be like?

    • #93900
      Jorge –
      Member

      Sipping from here and there I put together this one (in AppleScript), in case someone ever finds it useful:

      tell application “Adobe InDesign CC 2017”
      tell document 1
      try
      set theImages to all graphics of layer “C”
      repeat with thisImage in theImages
      set the properties of thisImage to {fill color:swatch “C=100 M=0 Y=0 K=0”}
      end repeat
      end try
      try
      set theImages to all graphics of layer “M”
      repeat with thisImage in theImages
      set the properties of thisImage to {fill color:swatch “C=0 M=100 Y=0 K=0”, overprint fill:true}
      end repeat
      end try
      try
      set theImages to all graphics of layer “Y”
      repeat with thisImage in theImages
      set the properties of thisImage to {fill color:swatch “C=0 M=0 Y=100 K=0”, overprint fill:true}
      end repeat
      end try
      end tell
      end tell

      • #93901
        Jorge –
        Member

        I was under the impression that the default [Black] always overprints, but in this kind of layout, if the bitmap placed in the K layer, with [Black] fill, is not set to overprint, it knocks out the images below it with Y, M and C fills (fills of Y and M also set to overprint). So here is the corrected script:

        tell application “Adobe InDesign CC 2017”
        tell document 1
        try
        set theImages to all graphics of layer “C”
        repeat with thisImage in theImages
        set the properties of thisImage to {fill color:swatch “C=100 M=0 Y=0 K=0”}
        end repeat
        end try
        try
        set theImages to all graphics of layer “M”
        repeat with thisImage in theImages
        set the properties of thisImage to {fill color:swatch “C=0 M=100 Y=0 K=0”, overprint fill:true}
        end repeat
        end try
        try
        set theImages to all graphics of layer “Y”
        repeat with thisImage in theImages
        set the properties of thisImage to {fill color:swatch “C=0 M=0 Y=100 K=0”, overprint fill:true}
        end repeat
        end try
        try
        set theImages to all graphics of layer “K”
        repeat with thisImage in theImages
        set the properties of thisImage to {overprint fill:true}
        end repeat
        end try
        end tell
        end tell

Viewing 1 reply thread
  • You must be logged in to reply to this topic.
Forum Ads