-
1. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
TᴀW Nov 17, 2009 12:15 PM (in response to TᴀW)okay, here's where I am now:
mydoc= app.activeDocument.allGraphics[0].imageTypeName
This returns "Photoshop" if it's a Photoshop placed image. But, how do I figure out if it's in bitmap mode?
-
2. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
TᴀW Nov 17, 2009 12:18 PM (in response to TᴀW)As this is urgent for me, I'm posting my slow progress, but if anyone can speed things up for me it really would be soo helpful!
okay, in the UI Info palette there is an entry called: Color Space. If the image is bitmap, this shows "Black and White". How do I access this in the object model? Color Space does not seem to be a property of graphic.
-
3. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
Harbs. Nov 17, 2009 12:51 PM (in response to TᴀW)Hi Ariel,
I don't see a way within the DOM to find the color space of a placed
image. The only two ways I can think of off-hand is to have Photoshop
do that for you, or to parse the image file.
You might be able to figure it out with an educated guess based on the
file name (i.e. tif or jpeg, etc.) and file size as well.
Harbs
Innovations in Automation
-
4. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
TᴀW Nov 17, 2009 1:02 PM (in response to Harbs.)Hi Harbs,
Thanks for the reply.
I also haven't been able to find anything. But, I think that only bitmap
(1-bit) images have the property overprintFill.
Now I'm having a simpler problem of testing with a given image has that
property.
Using hasOwnProperty("overprintFill") always returns true. But trying to
read that property results in an error.
I've tried this, and it's not working:
mygraphics = app.activeDocument.allGraphics;
for (aa=0; aa<mygraphics.length; aa++){
if (mygraphics[aa].imageTypeName == "Photoshop"){
try{
alert (aa + mygraphics[aa].overprintFill);
mygraphics[aa].overprintFill;
mygraphics[aa].select();
exit();}
catch(e){};
}
}
Any ideas gratefully accepted.
Ariel
(And I hope you've got a lightning protector on your computer
-
5. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
TᴀW Nov 17, 2009 1:22 PM (in response to TᴀW)Well, this seems to work, setting all placed Photoshop bitmaps to overprint. Provided I'm correct that only bitmap have an overprintFill attribute:
mygraphics = app.activeDocument.allGraphics;
for (aa=0; aa<mygraphics.length; aa++){
if (mygraphics[aa].imageTypeName == "Photoshop"){
try{
mygraphics[aa].overprintFill = true;
alert("Page: " + mygraphics[aa].parent.parent.name + " | Name: " + mygraphics[aa].itemLink.name);
}
catch(e){};
}
}If anyone has any comments, I'd love to hear.
Thanks,
Ariel
-
6. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
Harbs. Nov 17, 2009 1:53 PM (in response to TᴀW)Makes sense. They all have an overprint property, but you would only
be able to set the overprint property on a bitmap (as in the UI).
Harbs
-
7. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
TᴀW Nov 17, 2009 2:23 PM (in response to Harbs.)Yes. But the only problem is that I'm not sure if bitmaps are the only
Photoshop graphics that have that property settable. In my case, I anyway
only have bitmpas and CMYK, so that's okay (I hope). But this script could
be doing unwanted things. I still wonder where InDesign gets it's "color
mode" information from (as displayed in the Info palette), and why it's not
accessible to scripting. I think it should be, no?
-
8. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
Laubender Nov 18, 2009 4:43 AM (in response to TᴀW)Ariel,
you can apply "overprint" to grayscale images as well.
Uwe
-
9. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
TᴀW Nov 18, 2009 4:58 AM (in response to Laubender)Oho! So can you think of anything which distinguishes a bitmap so I can
figure out with a script if the image is a bitmap?
-
10. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
Laubender Nov 18, 2009 5:10 AM (in response to Laubender)At least when they are TIFF images.
Uwe
-
11. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
TᴀW Nov 18, 2009 5:16 AM (in response to Laubender)Well, they're not. OTH, in this project there aren't any greyscale images
either.
-
12. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
Laubender Nov 18, 2009 5:25 AM (in response to TᴀW)Hi, Ariel!
Try something like this (a bitmap TIFF image is selected):if (app.selection[0].allGraphics[0].properties.toSource().match(/space:"Schwarzweiß"/g)=="sp ace:\"Schwarzweiß\""){
app.selection[0].fillColor="Yellow";
};Since I'm working with an german version of InDesign the space-property for an bitmap TIFF image is "Schwarzweiß". So figure out what the ESTK exactly tells you when you check with the properties.toSource()-method. It might be: match(/space:"bitmap"/g) which translates to:
if (app.selection[0].allGraphics[0].properties.toSource().match(/space:"bitmap"/g)=="space:\ "bitmap\""){
app.selection[0].fillColor="Yellow";
};Uwe
-
13. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
Laubender Nov 18, 2009 5:33 AM (in response to Laubender)Of course you need something like this:
if (app.selection[0].allGraphics[0].properties.toSource().match(/space:"Schwarzweiß"/g)=="sp ace:\"Schwarzweiß\""){
app.selection[0].allGraphics[0].overprintFill=true; };
The fillColor="Yellow" was for testing only.
Uwe
-
14. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
TᴀW Nov 18, 2009 5:59 AM (in response to Laubender)Very good! In English it's: space:"Black and White"
Thanks for introducing me to the method toSource!
Ariel
-
15. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
Laubender Nov 18, 2009 6:27 AM (in response to TᴀW)You might want to add another if-statement:
if(app.selection[0].allGraphics[0].fillColor.name == "Black")
Because you can colorize a bitmap TIFF to any color of your swatches panel, it would be unfortunate to overprint a color like "Yellow" to a background color like "Cyan". The output you'll get would be a green. Imagine your overprinting bitmap TIFF overlaps different colors the effect might not what you want at all.
Uwe
-
16. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
Laubender Nov 18, 2009 6:37 AM (in response to TᴀW)Oh, don't thank me for introducing you to the toSource()-method. Your thanks must go to Dirk Becker who introduced me to that method.
Uwe
-
17. Re: Set all placed Photoshop images in bitmap mode to overprint? IDCS4
AdobeScripts Nov 18, 2009 6:39 AM (in response to TᴀW)in VB I'm doing something like this:
If UCase$(myImgContainer.AllGraphics.Item(1).Space) = "RGB" Or _
UCase$(myImgContainer.AllGraphics.Item(1).Space) = "CMYK" Or _
UCase$(myImgContainer.AllGraphics.Item(1).Space) = "LAB" Or _
UCase$(Right(myImgContainer.AllGraphics.Item(1).Space, 4)) = "TONE" Then
' color
else
' Gray / BW
end if
and if you want to check if your image is image or vector:
If myImgContainer.AllGraphics.Item(1).ActualPpi(0) = 0 Then
' not vector
end if
robin
www.adobescripts.co.uk