Thread View: adobe.scripting.indesign
11 messages
11 total messages
Started by Alexandre_VERCAMMEN
Thu, 26 Feb 2009 16:32
[JS][CS3] Print DIalog Box with ESCAPE
Author: Alexandre_VERCAMMEN
Date: Thu, 26 Feb 2009 16:32
Date: Thu, 26 Feb 2009 16:32
4 lines
770 bytes
770 bytes
I am using document.print(true) in my script. Is there a way to catch if the user pressed "CANCEL"? So I can keep track of how many prints were "skipped" Thank you, Alex.
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: jongware
Date: Fri, 27 Feb 2009 16:11
Date: Fri, 27 Feb 2009 16:11
17 lines
1249 bytes
1249 bytes
Unfortunately, print has a prototype
void print ([printDialog:bool][, using:any])
where the 'void' indicates it does not return a value.
I wonder if this can be wrapped by the CS4 Event object. That has properties 'cancelable' (if true, cancelling is allowed) and 'defaultPrevented' (if true, default behavior has been cancelled). Idle rambling, because 1. I have no idea at all how to work with Events, 2. most likely, ID does not 'update' the current Print dialog to
[..] keep track of how many prints were "skipped"
(i.e., you still won't know where it was), and 3. I don't even know if you have CS4, or an older version.
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: Alexandre_VERCAMMEN
Date: Fri, 27 Feb 2009 16:31
Date: Fri, 27 Feb 2009 16:31
5 lines
901 bytes
901 bytes
I have CS3, topic [JS][CS3]. I am looping through documents being batched. So each time the print dialogue would return "null" for a cancel, I would know that document was skipped. Unfortunately, like you said print has no return value. Would there be a way to test the last keystroke?
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: Kasyan_Servetsky
Date: Fri, 27 Feb 2009 16:56
Date: Fri, 27 Feb 2009 16:56
1 lines
683 bytes
683 bytes
Rorohiko's APID has docPrinted event (sent after the document was printed).
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: Alexandre_VERCAMMEN
Date: Fri, 27 Feb 2009 17:11
Date: Fri, 27 Feb 2009 17:11
2 lines
753 bytes
753 bytes
Nothing on the InDesign side? Otherwise it would mean another purchase/plug-in but most annoyingly an install. We're on tight "security" restriction here...
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: Kasyan_Servetsky
Date: Fri, 27 Feb 2009 18:07
Date: Fri, 27 Feb 2009 18:07
1 lines
679 bytes
679 bytes
It's indispensable tool for everybody who is serious about scripting.
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: Harbs
Date: Sat, 28 Feb 2009 23:50
Date: Sat, 28 Feb 2009 23:50
9 lines
859 bytes
859 bytes
Kasyan_Servetsky@adobeforums.com wrote: > It's indispensable tool for everybody who is serious about scripting. > I second that! -- Harbs http://www.in-tools.com
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: Alexandre_VERCAMMEN
Date: Mon, 02 Mar 2009 20:20
Date: Mon, 02 Mar 2009 20:20
1 lines
771 bytes
771 bytes
I went on the website looking for "DocPrinted" but did not find an API plug-in related to printing. I've sent an email to their support with the same question. No response yet.
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: Kasyan_Servetsky
Date: Tue, 03 Mar 2009 09:05
Date: Tue, 03 Mar 2009 09:05
5 lines
899 bytes
899 bytes
Alexandre, I was referencing to the Active Page Item Developer plug-in. You can read detailed information about it and download demo version here: <http://www.rorohiko.com/wordpress/indesign-downloads/active-page-item-developer/> Kasyan
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: Harbs
Date: Wed, 04 Mar 2009 13:27
Date: Wed, 04 Mar 2009 13:27
52 lines
2655 bytes
2655 bytes
Just a quick illustration of how useful APID is:
My wife still uses CS2 at work. We have a Riso digital duplicator which
we use for printing booklets, invitations, etc. When printing from
InDesign to the Riso machine, color management must be off or the blacks
get printed as dark gray (about 95% line screen). Well, I tried to help
out by printing a booklet, and like usual, I messed up and forgot to
turn off color management. (I'm really good at messing things up!) ;)
I decided to put an end to this problem, and create a solution which
would always cause InDesign to send to this printer (only) with color
management turned off. It took me a total of maybe 15 minutes...
// DontManageColorForRiso.jsx
// This script should be in the same folder as the document
DontManageColorForRisoSourceCS4.indd
// It is automatically called by the DontManageColorForRisoController
page item.
//events: docPrintConfigured,docPrinted
// Header - matches anonymous function trailer at bottom
(function(thePlugin)
{
main();
function main(){
var theEventCode = thePlugin.eventCode;
var doc = GetDocFromPageItem(thePlugin);
switch(theEventCode){
case "docPrintConfigured":TurnOffColorManagement(doc);break;
case
"docPrinted":app.colorSettings.enableColorManagement=true;break;
}
}
function TurnOffColorManagement(doc){
var printer = doc.printPreferences.printer;
if(printer.constructor.name!="String"){return}
printer=printer.toLowerCase();
if(printer.match(/riso/)){
app.colorSettings.enableColorManagement=false;
}
}
function GetDocFromPageItem (pageItem){
var guid = app.callExtension(0x90B6C,10014,pageItem);
return app.callExtension(0x90B6C,10009,guid);
}
// Trailer - matches anonymous function header at top
}
)(theItem);
--
Harbs
http://www.in-tools.com
Re: [JS][CS3] Print DIalog Box with ESCAPE
Author: Alexandre_VERCAMMEN
Date: Wed, 04 Mar 2009 15:23
Date: Wed, 04 Mar 2009 15:23
8 lines
990 bytes
990 bytes
Marveleous tools. I would not be able to do that fix in 15 min! The event handler sounds a lot like InEventScript plug in. The later has not been transported to CS3 since CS3 handles events. But it seems API is a little more thorough in its functions! One downfall is I have to struggle w/ limited user privilege and installing anything is restricted. If in their good graces I fall...
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads