Indesign Error Message Variable
Indesign Error Message Variable
When InDesign checks a file and has missing fonts or images, I can't get the error message, as a variable, to display in my email send. I'm using the [Job.FailMessage](and have tried other variables) but nothing shows up. How might I get the error to display in my email?
			
			
									
						
										
						Re: Indesign Error Message Variable
Hi,
You can use a script in the command section to investigate the document and then output an error message :
Then get the message :

HTH,
Loic
http://www.ozalto.com
			
			
									
						
										
						You can use a script in the command section to investigate the document and then output an error message :
Code: Select all
function checkDoc(doc) {
	var fts = doc.fonts;
	var lks = doc.links;
	var missingFonts = [];
	var missingLinks = [];
	var n = fts.length;
	var msg = "";
	while (n--) {
		if ( /SUBSTITUTED|NOT_AVAILABLE/.test ( fts[n].properties.status.toString() ) ){
			missingFonts [ missingFonts.length ] = fts[n].name.replace ( /\t+/g, " ");
		}
	}
	n = lks.length;
	
	while (n--) {
		if ( /LINK_MISSING|LINK_INACCESSIBLE/.test ( lks[n].properties.status.toString() ) ) {
			missingLinks[ missingLinks.length ] = lks[n].name;
		}
	}
	
	if ( missingFonts.length ) msg+= missingFonts.length+" missing fonts ["+missingFonts.join()+"]. ";
	if ( missingLinks.length ) msg+= missingLinks.length+" missing links ["+missingLinks.join()+"]. ";
	
	return ( missingFonts.length || missingLinks.length )? msg : "";
}
var c = checkDoc($doc);
c!="" && $error = c;
HTH,
Loic
http://www.ozalto.com