🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #803

Re: [JS][CS3] Print DIalog Box with ESCAPE

#803
From: Harbs
Date: Wed, 04 Mar 2009 13:27
52 lines
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
Technical Details
Message-ID: <C94E2BF1F09203DCA1EEE967E59FCAC7@in.webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing
References: <59b80ed5.-1@webcrossing.la2eafNXanI> <59b80ed5.7@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,2232b21bcb70529c
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Harbs
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: [JS][CS3] Print DIalog Box with ESCAPE
Message-ID: <C94E2BF1F09203DCA1EEE967E59FCAC7@in.webcrossing.la2eafNXanI>
Date: Wed, 4 Mar 2009 05:27:15 -0800
References: <59b80ed5.-1@webcrossing.la2eafNXanI> <59b80ed5.7@webcrossing.la2eafNXanI>
Lines: 52
User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421)
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Original-Lines: 56