Documents don't have fill colors or stroke colors. Objects do. Documents have colors and swatches.
What are you trying to do?
Hi, Harbs! Thanks for the support
I'm trying to get currently, selected in tool palette, fill Color and stroke Color. They depend
on currently selected document, so I thought they belong to the Document object.
Not from swatches, objects or layers. Just two current default colors for stroke and fill from tool palette.
They do, but unless I'm mistaken, the pageItemDefaults property simply does not return the correct value!
alert ("Fill: "+app.activeDocument.pageItemDefaults.fillColor.name+ "\rStroke: "+app.activeDocument.pageItemDefaults.strokeColor.name+ "\rFont: "+app.activeDocument.textDefaults.appliedFont.name);
-- changing the default font works, but changing fill & stroke does not. Quite irritatingly, if you force the color before running this script with
app.activeDocument.pageItemDefaults.fillColor = app.activeDocument.swatches.item("Black");
it is reported "correctly"
Thank you, Jongware
But is there a way to get RGB (CMYK or any) value for those colors?
The numbers depend on the color.model
[EDIT] That should have been "The numbers depend on the color.space"
Umm. My alert line should have worked but it didn't. ... Only if you set the color yourself, first.
yeah, Jongware - and what I want is to get fillColor in any case.
And, Harbs, how do I get the colorValue of app.activeDocument.pageItemDefaults.fillColor ? As I can see, it is swatch and not the color.
app.activeDocument.pageItemDefaults.fillColor.colorValue always seems to be undefined.
Maybe there's another way to get current fill color? In Photoshop, for example, it's very simple - app.backgroundColor.rgb,
but in InDesign there's no such a variable.