Copy link to clipboard
Copied
Hi,
Is anyone aware of a way to batch colourise placed tiffs?
By that I mean when you place a greyscale tiff, double-click or use direct selection tool, go to Swatches, and pick the colour you want. Effectively creating a monotone image instead of using Photoshop.
I want to do that to over 300 images in the same document without using Photoshop for that.
Object styles won't do it.
Find/change won't do it.
Is there a trick, script or workaround to batch it?
Ta
set s to "PANTONE 286 C"
set theLayer to "Layer 1"
tell application "Adobe InDesign CC 2017"
tell active document
set im to all graphics
set c to item 1 of (every swatch whose name is s)
repeat with x in im
try
if class of x is image and space of x is "Grayscale" and item layer of x is layer theLayer then
set fill color of x to c
end if
end try
end repeat
end tell
end tell
Copy link to clipboard
Copied
It sounds as though an image could be made various colors. If so, how would a script know what specific color to make an image? Or, would you want a random color applied?
Copy link to clipboard
Copied
It picks a particular swatch to use, e.g. "Pantone 286 C"
Copy link to clipboard
Copied
I found a script that I think would do what I'm after but I can't even get it to compile to try out.
tell application "Adobe InDesign CC 2017"
tell document 1
try
set theImages to all graphics of layer “Layer 1”
repeat with thisImage in theImages
set the properties of thisImage to {fill color:swatch “Pantone 286 C”}
end repeat
end try
end tell
end tell
Copy link to clipboard
Copied
Try this:
set s to "PANTONE 286 C"
tell application "Adobe InDesign CC 2017"
set im to all graphics of active document
set c to item 1 of (every swatch of active document whose name is s)
repeat with x in im
try
if class of x is image and space of x is "Grayscale" then
set fill color of x to c
end if
end try
end repeat
end tell
Copy link to clipboard
Copied
WOW!
I couldn't get it to work until I realised "Grayscale" needed to be "Greyscale" (I'm in the UK).
That's awesome. That really helps. Many thanks.
Copy link to clipboard
Copied
Did you then also need 'set fill colour of ..."?
Copy link to clipboard
Copied
Rob,
There's one issue with the script and that's it will pick up any greyscale image and colour it.
I've done a quick test and there's another image in the document that gets coloured.
Is there a way to adapt the script so it choose a specific layer first, e.g. "Layer 1"? Then it will only colour greyscale images on that layer.
Copy link to clipboard
Copied
set s to "PANTONE 286 C"
set theLayer to "Layer 1"
tell application "Adobe InDesign CC 2017"
tell active document
set im to all graphics
set c to item 1 of (every swatch whose name is s)
repeat with x in im
try
if class of x is image and space of x is "Grayscale" and item layer of x is layer theLayer then
set fill color of x to c
end if
end try
end repeat
end tell
end tell
Copy link to clipboard
Copied
Again, thank you so much. That now adds a bit of security rather than blanket changing greyscale tiffs.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now