Hi - the script does a whole load of things like opening multiple illustrator files, hiding layers and exporting a number of jpegs that need to be rotated (new Illustrator functionality! now allows this so the jpegs are the right way up) and combined into a pdf for customer approval. So the final step would be easy I guess in acrobat but can it be done from the Illustrator scripting engine? Haven't used BridgeTalk - is this the way to go?
Thanks
This should create a PDF Presentation in Photoshop via BridgeTalk, thePath and theFiles need to be amended naturally:
var thePath = "~/Desktop/aPdfPresentation.pdf";
var theFiles = ["~/Desktop/gradient01.jpg", "~/Desktop/gradient02.jpg"];
saveAsPdfPresentationFromIllustrator (theFiles, thePath);
////// save pdf presentation //////
function saveAsPdfPresentationFromIllustrator (theFiles, thePath) {
// the bridgetalk;
var bt = new BridgeTalk;
bt.target = 'photoshop';
var myScript = 'app.bringToFront();\n';
var theString = "[\""+String(theFiles.join("\",\""))+"\"]";
myScript += 'var theFiles = '+String(theString)+';\n';
myScript += 'var thePath = \"'+String(thePath)+'\";\n';
myScript += ' var idPDFExport = stringIDToTypeID( "PDFExport" );\n';
myScript += ' var desc1 = new ActionDescriptor();\n';
myScript += ' var idflst = charIDToTypeID( "flst" );\n';
myScript += ' var list1 = new ActionList();\n';
myScript += ' for (var m = 0; m < theFiles.length; m++) {\n';
myScript += ' list1.putPath( new File( theFiles[m] ) );\n';
myScript += ' };\n';
myScript += ' desc1.putList( idflst, list1 );\n';
myScript += ' var idT = charIDToTypeID( "T " );\n';
myScript += ' desc1.putPath( idT, new File( thePath ) );\n';
myScript += ' var idincludeAnnotations = stringIDToTypeID( "includeAnnotations" );\n';
myScript += ' desc1.putBoolean( idincludeAnnotations, true );\n';
myScript += ' var idBckC = charIDToTypeID( "BckC" );\n';
myScript += ' var idBckC = charIDToTypeID( "BckC" );\n';
myScript += ' var idWht = charIDToTypeID( "Wht " );\n';
myScript += ' desc1.putEnumerated( idBckC, idBckC, idWht );\n';
myScript += ' var idAs = charIDToTypeID( "As " );\n';
myScript += ' var desc2 = new ActionDescriptor();\n';
myScript += ' var idpdfPresetFilename = stringIDToTypeID( "pdfPresetFilename" );\n';
myScript += ' desc2.putString( idpdfPresetFilename, "High Quality Print" );\n';
myScript += ' var idpdfPreserveEditing = stringIDToTypeID( "pdfPreserveEditing" );\n';
myScript += ' desc2.putBoolean( idpdfPreserveEditing, false );\n';
myScript += ' var idpdfDownSample = stringIDToTypeID( "pdfDownSample" );\n';
myScript += ' var idpdfDownSample = stringIDToTypeID( "pdfDownSample" );\n';
myScript += ' var idNone = charIDToTypeID( "None" );\n';
myScript += ' desc2.putEnumerated( idpdfDownSample, idpdfDownSample, idNone );\n';
myScript += ' var idpdfCompressionType = stringIDToTypeID( "pdfCompressionType" );\n';
myScript += ' desc2.putInteger( idpdfCompressionType, 7 );\n';
myScript += ' var idPhtP = charIDToTypeID( "PhtP" );\n';
myScript += ' desc1.putObject( idAs, idPhtP, desc2 );\n';
myScript += ' executeAction( idPDFExport, desc1, DialogModes.NO );\n';
bt.body = myScript;
bt.send(10);
};