give this a go, however it will only convert compatible print drivers- what driver are you using?
function printJobHook(inputs, actions) {
var CONVERT_MESSAGE = 'Your job contains color pages. Would you like to convert your job to grayscale? Selecting "No" will print the job in color, Selecting "YES" will change the job to greyscale.';
if (!inputs.job.isAnalysisComplete) {
return;
}
if (inputs.job.isColor) {
if (inputs.client.isRunning) {
var response = actions.client.promptYesNo(CONVERT_MESSAGE);
if (response == 'NO') {
actions.log.debug('User chose to keep on printing in color');
} else if (response == 'TIMEOUT') {
actions.log.debug('Dialog timed out, canceling job.');
actions.job.cancel();
} else {
actions.log.debug('User chose to convert their job to grayscale.');
actions.job.convertToGrayscale();
}
} else {
actions.log.debug('Canceling job due to high number of color pages and user not running client software.');
actions.job.cancel();
}
}
}