Is this possible to achieve the requirement with Adobe Bridge Concepts?
Hi,
Following up from my previous post here is a rough script that would list the spot colours per illustrator document. It is not very pretty the output is just IllustratorFileName, Spot Colour, Spot Colour 2, ,, IllustratorFileName2, Spot Colour 3, Spot Colour 4.
But it gives the idea of how to do it, and I have just used the code above provided by @rob day and wrapped it in a function that calls for each illustrator link.
//alert(checkSpots(app.activeDocument));
// call a new function that wraps the function above
var spotsPerFile = checkSpotsPerFile ( );
alert ( spotsPerFile);
function checkSpotsPerFile (){
var totalArray = [];
// get all the links in the document
var links = app.activeDocument.links;
for ( var j = 0 ; j < links.length; j++){
var curLink = links[j];
// check they are illustrator links
if ( curLink.linkXmp.creator.indexOf("Illustrator") !== -1) {
var newDoc = app.documents.add(false);
newDoc.pages[0].place ( curLink.filePath);
totalArray.push( curLink.name);
totalArray.push ( checkSpots ( newDoc));
newDoc.close(SaveOptions.NO);
}
}
return totalArray;
}
/**
* Gets a list of spot colors from placed files
* @Return an array of color names
*
*/
function checkSpots(d){
var p=d.colors;
var darray = ["Black", "Cyan", "Magenta", "Yellow", "Paper", "Registration"];
var placeSpots = [];
for (var i = 0; i < p.length; i++){
if (!checkItem(darray, p[i].name)) {
var theName = p[i].name
try {
p[i].name = p[i].name + "!";
}catch(e) {
placeSpots.push(p[i].name)
continue;
}
p[i].name = theName
}
}
return placeSpots
}
/**
* Checks if an item is in an array
* @Param the array to check
* @Param the item to look for
* @Return true if the item is in the array
*
*/
function checkItem(a, obj) {
for (var i = 0; i < a.length; i++) {
if (a[i] === obj) {
return true;
}
}
return false;
}
Hope this helps
Malcolm