Indesign, get xml data for colours used in placed pdf

HI

I can use the below to get some of what meta data I need from a placed PDF in Indesign CS5.5, ie page height, width, apart from the colours used, the question is what would I use/add to get the colours used in the PDF?

set my_PDF to POSIX path of (choose file)
do shell script "mdls " & quoted form of my_PDF

cheers

Hi Budgie,

You can get all xml data for images (not eps!) with sips:

set my_PDF to POSIX path of (choose file)
do shell script "sips -g allxml " & quoted form of my_PDF

and not as xml:

set my_PDF to POSIX path of (choose file)
do shell script "sips -g all " & quoted form of my_PDF

Or be more specific with:

set my_PDF to POSIX path of (choose file)
do shell script "sips -g space " & quoted form of my_PDF

Returning the color space.

Although, I can’t determine if you could get a list of colours used.
(I am presuming, for example… CMYK plus spot colours)

mdls is a command to read the Spotlight metadata added to files as they are imported by a Spotlight importer. If the metadata wasn’t added, you can’t get it – and and the list of colours isn’t. I don’t think sips will give it to you, either.

What you might be able to do is delete the colours in an InDesign document, add the PDF, and see what colours were added.

Hi,

if a swatch is added to the document when importing a PDF the swatch will be protected.
So may be a work around which tries to remove a swatch will do the job.

Sorry for the JS, but I’m not on a mac this evening …

var mySwatchList = [];
var mySwatches = app.activeDocument.swatches;
for(var i = mySwatches.length -1;  i >= 0; i--)
{
	var mySwatch = mySwatches[i];
try{
	mySwatch.remove()
	app.activeDocument.undo()
	}catch (e){
		var swatchName = mySwatch.name
		if(swatchName != 'Paper' && swatchName != 'Registration' && swatchName != 'None' && swatchName != 'Black')
	myList.push(swatchName)
	}
}

cheers for the suggestion’s guys

I have been doing pretty well much what Shane is suggesting, was just looking into other ways to do it.