Copy link to clipboard
Copied
Hi forum,
I need a great help from you.
There are number of filled items on a page.
And i do want to get Alert, the value of Cyan inside a swatch.
Any possible to get this.
thanks...forum....
HI
try this
var myDoc = app.activeDocument;
var myPage = myDoc.pages;
for (var p=0; myPage.length>p; p++){
var myItem = myPage
.pageItems.everyItem().getElements();
for (var i=0; myItem.length>i; i++){
var cyen = myItem.fillColor;
if (myItem.fillColor.name!="None"){
if ((myItem.fillColor.model == ColorModel.SPOT) && (myItem.fillColor.space) )
alert(myItem.fillColor.name )
}
}
}
Mi_D
Copy link to clipboard
Copied
Hi
try this
var myDoc = app.activeDocument;
var myPage = myDoc.pages;
for (var p=0; myPage.length>p; p++){
var myItem = myPage
.pageItems.everyItem().getElements();
for (var i=0; myItem.length>i; i++){
try{
var cyen = myItem.fillColor;
alert(cyen.colorValue[0])
}
catch(e)
{e}
}
}
Mi_D
Copy link to clipboard
Copied
Hi,
I would think, that the current element should be selected, if the value is displayed and that there is no need to display a value of "0" ?
And: Mi_Ds and my snippet does not find strokes, fill color in table cells and fill color in text at the moment.
var doc = app.activeDocument;
var allPItems = doc.allPageItems;
for ( var i = 0; i < allPItems.length; i++ ) {
var curItem = allPItems;
if ( curItem != "[object Group]" ) {
if ( curItem.fillColor.name != "None" ) {
var fColor = curItem.fillColor;
var cyan = fColor.colorValue[0];
if ( cyan != 0 ) {
curItem.select();
alert( "Selected object has a cyan value of: " + cyan );
} // if
} // if
} // if
} // for
Copy link to clipboard
Copied
Hi
MI_D &&
Many thanks for the support.
One more support needed to get alert of the coors.
How to find the spot color, with the Color mode as CMYK.
Please see the find attachement for better understanding.
Many thanks for the support.
Copy link to clipboard
Copied
Hi Unique,
Unique wrote:
… needed to get alert of the coors.How to find the spot color …
what is a „coors“ ?
If you looking for the color value of your UNIQUE COLOR swatch, you can do something like this:
var aDoc = app.activeDocument;
var aSwatch = aDoc.swatches.itemByName('UNIQUE COLOR');
alert(aSwatch.colorValue);
(Info: Be sure, that a swatch with this name exists.)
Have fun
Copy link to clipboard
Copied
Hi
To find color type color mode like that
var myDoc = app.activeDocument;
var myPage = myDoc.pages;
for (var p=0; myPage.length>p; p++){
var myItem = myPage
.pageItems.everyItem().getElements();
for (var i=0; myItem.length>i; i++){
try{
var cyen = myItem.fillColor;
if (myItem.fillColor.model == ColorModel.SPOT && myItem.fillColor.space )
alert(myItem.fillColor.name )
}
catch(e)
{alert(e)}
}
}
Mi_D
Copy link to clipboard
Copied
Hi Mi_D,
Im sorry for the delayed response, since i was in my annual leave.
Mi_D!...thanks for your reply,... & only one clarifications..
when there is any rectangle box filled with None & stroke applied. or fill or stroke both "None".
the above script show error..
i tried to mention in script like this but no result..
if (myItem.fillColor.model == ColorModel.NONE && myItem.fillColor.space )
any help on this..
Copy link to clipboard
Copied
please see the above snapshot.....
while running the above script.... it doesnt find the objects with Fill Color NONE & stroke color applied or not....
Copy link to clipboard
Copied
HI
try this
var myDoc = app.activeDocument;
var myPage = myDoc.pages;
for (var p=0; myPage.length>p; p++){
var myItem = myPage
.pageItems.everyItem().getElements();
for (var i=0; myItem.length>i; i++){
var cyen = myItem.fillColor;
if (myItem.fillColor.name!="None"){
if ((myItem.fillColor.model == ColorModel.SPOT) && (myItem.fillColor.space) )
alert(myItem.fillColor.name )
}
}
}
Mi_D
Copy link to clipboard
Copied
Thank you so much for your support Mi_D.
I would really like to appreciate the tendency of helping....
I would like to give a point and close the thread...
Would like to post a new question regarding this...
Many thanks Mi_D...
Copy link to clipboard
Copied
Thank you so much for your support Mi_D.
I would really like to appreciate the tendency of helping....
I would like to give a point and close the thread...
Would like to post a new question regarding this...
Many thanks Mi_D...
Copy link to clipboard
Copied
Thank you so much for your support Mi_D.
I would really like to appreciate the tendency of helping....
I would like to give a point and close the thread...
Would like to post a new question regarding this...
Many thanks Mi_D...