🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #15051

Don't work .activePrinterPreset

#15051
From: Vitaly Batushev
Date: Tue, 06 Jan 2004 12:10
81 lines
3111 bytes
This is my script for print separated postscript file.
with (app)
{
	if (documents.length < 1)	{
		alert("No Open Documents!");
		exit();
	}
	var myDoc = activeDocument;

	DeleteTempPresets();
// printerPresets[7] - my PrinterPreset for create separated
postscript file
	myDoc.printPreferences.activePrinterPreset = printerPresets[7];

	var myFileC = new File("/d/cyan.ps");
	var myFileM = new File("/d/magenta.ps");
	var myFileY = new File("/d/yellow.ps");
	var myFileK = new File("/d/black.ps");
	
	var myPresetCyan = printerPresets[7].duplicate();
	with (myPresetCyan) {
 		name = "TempPrintCyan";
		printBlack = false;
		printCyan = true;
		printMagenta = false;
		printYellow = false;
		printFile = myFileC;
	}
	var myPresetMagenta = printerPresets[7].duplicate();
	with (myPresetMagenta) {
 		name = "TempPrintMagenta";
		printBlack = false;
		printCyan = false;
		printMagenta = true;
		printYellow = false;
		printFile = myFileM;
	}	
	var myPresetYellow = printerPresets[7].duplicate();
	with (myPresetYellow) {
 		name = "TempPrintYellow";
		printBlack = false;
		printCyan = false;
		printMagenta = false;
		printYellow = true;
		printFile = myFileY;
	}	
	var myPresetBlack = printerPresets[7].duplicate();
	with (myPresetBlack) {
 		name = "TempPrintBlack";
		printBlack = true;
		printCyan = false;
		printMagenta = false;
		printYellow = false;
		printFile = myFileK;
	}

 	myDoc.print(false, myPresetCyan);
	myDoc.print(false, myPresetMagenta);
	myDoc.print(false, myPresetYellow);
 	myDoc.print(false, myPresetBlack);

	DeleteTempPresets();	
}

function DeleteTempPresets()
{
	for (i = 0; i < app.printerPresets.length; i++)	{
		if (app.printerPresets[i].name == "TempPrintCyan") {
app.printerPresets[i].remove(); }
		if (app.printerPresets[i].name == "TempPrintMagenta") {
app.printerPresets[i].remove(); }
		if (app.printerPresets[i].name == "TempPrintYellow") {
app.printerPresets[i].remove(); }
		if (app.printerPresets[i].name == "TempPrintBlack") {
app.printerPresets[i].remove(); }
	}	
}
Why myDoc.print don't work correctly?
Why the condition of the &#1097;roperties printCyan, printMagenta,
printYellow and printBlack is not taken into print?!
All colors, even what were switched off are printed!
Technical Details
Message-ID: <69e570a0.0401060410.3a04da7d@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,5ee03b05b4a3c6fa,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2004-01-06 04:10:35 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: vbatushev@knews.polenet.ru (Vitaly Batushev)
Newsgroups: adobe.scripting.indesign
Subject: Don't work .activePrinterPreset
Date: 6 Jan 2004 04:10:34 -0800
Organization: http://groups.google.com
Lines: 81
Message-ID: <69e570a0.0401060410.3a04da7d@posting.google.com>
NNTP-Posting-Host: 81.16.131.147
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1073391035 22608 127.0.0.1 (6 Jan 2004 12:10:35 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 6 Jan 2004 12:10:35 +0000 (UTC)