All the CMYK images are tagged, and yes the job options are set to No Conversion. Here's the scriot as it stands. You will need to replace preset1-3 with joboptions within your export sets. There is a spot at the top of the code that I commented out indicating where the "break" might go?
d = app.activeDocument;
if (checkForRGB()) {
alert("Document contains RGB color");
//Insert a break here?
} else {
//alert("No RGB color")
}
/**
* Checks Document for RGB Color
* @ return true if RGB objects are found
*
*/
function checkForRGB(){
var d = app.activeDocument
//Make a new Preflight Profile
var pf = makePreflight("TestNoRGB");
var cs = makeRule(pf, "ADBE_Colorspace")
cs.flag = PreflightRuleFlag.returnAsError;
var csNoRGB = cs.ruleDataObjects.itemByName("no_rgb")
csNoRGB.properties = {dataType:RuleDataType.BOOLEAN_DATA_TYPE, dataValue:true}
d.preflightOptions.preflightOff = false;
d.preflightOptions.preflightWorkingProfile = pf;
var pfp = app.preflightProcesses.add(d, pf)
pfp.waitForProcess();
if (pfp.processResults.length > 6) {
return true
} else {
return false
}
}
/**
* Makes a new Preflight
* @ param preflight name
* @ return the new preflight
*/
function makePreflight(n){
if (app.preflightProfiles.itemByName(n).isValid) {
return app.preflightProfiles.itemByName(n);
} else {
return app.preflightProfiles.add({name:n});
}
}
/**
* Makes a new Preflight Rule
* @ param preflight name
* @ param the preflight rule constant name
* @ return the new preflight rule
*/
function makeRule(pf, n){
if (pf.preflightProfileRules.itemByName(n).isValid) {
return pf.preflightProfileRules.itemByName(n);
} else {
return pf.preflightProfileRules.add(n);
}
}
// BS"D
// All rights reserved (c) 2015 by Id-Extras.com
// Free to use and modify but do not delete this copyright attribution.
// This script will export 2 pdfs of the current document
// Choose the PDF presets by altering their names below
// The second PDF gets a suffix added to its name.
// Modify the line below beginning name2 = to change the suffix.
// XYZ modified for 3 type pdfs...also holds all characters but removes .indd
d = app.activeDocument;
// Here you can choose the PDF preset
preset1 = app.pdfExportPresets.itemByName("HiRes_joboption");
preset2 = app.pdfExportPresets.itemByName("MedRes_joboption");
preset3 = app.pdfExportPresets.itemByName("LoRes_joboption");
if (!(preset1.isValid)){
alert("One of the presets does not exist. Please go to Vol1-Photoshop_Illustrator_InDesign_Acrobat_Stuff/AcrobatJobOptions_B/for actions, and load them into your setting folder");
exit();
}
//if (!(cancel)){alert("PDFs will not be created. Whaaa");
//exit();
//}
if (d.saved){
thePath = String(d.fullName).replace(".indd", "") + ".pdf";
thePath = String(new File(thePath).saveDlg());
}
else{
thePath = String((new File).saveDlg());
}
thePath = thePath.replace(/\.pdf$/, "");
name1 = thePath+".pdf";
// Here you can set the suffix at the end of the name
name2 = thePath+"_MR.pdf";
name3 = thePath+"_LR.pdf";
d.exportFile(ExportFormat.PDF_TYPE, new File(name1), false, preset1);
d.exportFile(ExportFormat.PDF_TYPE, new File(name2), false, preset2);
d.exportFile(ExportFormat.PDF_TYPE, new File(name3), false, preset3);