Page 1 of 1

Show Pantones Used In Design/File

Posted: Thu Sep 29, 2016 4:36 am
by bschlitt11
I am wondering if there is a way to generate the Pantones used in a design/file.

I am not wanting to see for myself or identify where they are used, ( I know how to do that )...
I'm wanting to show my customer the PDF proof/layout with the Pantones listed.

I can do it manually by drawing boxes and labeling the Pantones, but just wondering if there's an automated way to generate what colors are used in the design. Thanks in advance

Re: Show Pantones Used In Design/File

Posted: Thu Sep 29, 2016 3:03 pm
by loicaigon
Hi,

I did write a little snippet for you here but it might need to be adjusted:

Code: Select all

Array.prototype.contains =  function ( object )
{
	var i = 0, n = this.length;
	
	for ( i = 0 ; i < n ; i++ )
	{
		if ( this[i] === object )
		{
			return true;
		}
	}
	
	return false;
}

var main = function(doc) {
	var clrs = doc.colors.everyItem().getElements(),
	n = clrs.length, clr,
	unused = doc.unusedSwatches, 
	spotLayer = doc.layers.item ( "usedSpots" );
	
	
	spotLayer.isValid && spotLayer.pageItems.everyItem().remove();
	!spotLayer.isValid && spotLayerspotLayer = doc.layers.add ( {name:"usedSpots"});
	!spotLayer.index!=0 && spotLayer.move(LocationOptions.AT_BEGINNING);
	
	var spots = [];
	while ( n-- ) {
		clr = clrs[n];
		if ( clr.model == ColorModel.SPOT && !unused.contains ( clr ) ) {
			spots[ spots.length ] = clr;
		}
	}

	placeSpots ( doc, spots );

}

var placeSpots = function ( doc, aSpots ) {
	var p1 = doc.pages[0],
	pb = p1.bounds,
	tf, 
	tfProps = {
			geometricBounds:[pb[0]-22, pb[1], pb[0]-2, pb[3]], 
			fillColor:"None", 
			strokeColor:"None",
			pointSize:5
	},
	n = aSpots.length,
	table,
	tableProps = {
		 columnCount:2,
		 bodyRowCount:n,
	},
	row, colWidth = Math.abs (pb[3]-pb[1])/3;
	
	var hu = doc.viewPreferences.horizontalMeasurementUnits,
	 vu = doc.viewPreferences.verticalMeasurementUnits;
	 
	 doc.viewPreferences.horizontalMeasurementUnits = doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS;
	 tf = doc.textFrames.add( tfProps );
	 tf.textFramePreferences.properties = {
		verticalJustification:VerticalJustification.BOTTOM_ALIGN,
		useFixedColumnWidth:true,
		textColumnCount:3,
		textColumnFixedWidth:colWidth,
	};

	 table = tf.tables.add(tableProps);
	 
	 table.columns[0].width = colWidth*.1;
	  table.columns[1].width = colWidth*.9;
	 while ( n-- ) {
		row  = table.rows[n];
		row.cells[0].fillColor = aSpots[n];
		row.cells[1].contents = aSpots[n].name;
	}

	if ( doc.documentPreferences.slugTopOffset<22 ) {
		doc.documentPreferences.slugTopOffset = 22;
	}

	doc.viewPreferences.horizontalMeasurementUnits = hu;
	doc.viewPreferences.verticalMeasurementUnits = vu;
	 
}

main($doc);
Image

FWIW

Loic
www.ozalto.com

Then use this script as "command" in the INDesign configurator

Re: Show Pantones Used In Design/File

Posted: Thu Oct 06, 2016 1:33 pm
by abailescollins
Just for the record, you can do this also in PitStop With the 'Add Separation Names' Action Lists
They are in the 'Add' section of the standard Action Lists.
They add the separation names from each page independently