🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #20939

Re: Printing Postscript from script

#20939
From: Peter Boctor
Date: Mon, 20 May 2002 03:23
29 lines
2785 bytes
How you print postscript to disk from InDesign scripting changed from 1.5 to 2.0. 

First let me cover 2.0. There are basically 3 ways to get Postscript files out of InDesign 2 whether from the UI or scripting. Page 424 of the user manual talks about the characteristics of each. 

1. device independent
 2. device dependent
 3. device and driver dependent
 

The device independent format is always composite and things like orientation, page size, scaling are not specified. To get separations or set any of these options you need device dependent and you need to pick a PPD. 

From scripting to get 1 or 2, you don't have to deal with a driver at all. To get 3, you still have to do things the old 1.5 way (more on that below) 

Here's a quick example of some actual code that works under both OS 9 and OS X: 

 tell application "InDesign 2.0.1"      tell print preferences of document 1           set printer to postscript file           set print file to "Macintosh HD:Fred.ps"           -- for device independent/composite           set ppd to device independent            -- for device dependent/separations            -- set ppd to any ppd on the system            -- "ppd list" returns all installed ppds            set ppd to "Acrobat Distiller"     end tell      print document 1 without print dialog end tell  

For InDesign 1.5, you can't print without dealing with the driver. The best way to do this is:
 1. Set up a printer style in InDesign with whatever settings you want.
 2. Use the "Virtual printer" that is installed with the AdobePS driver. 

To set the Virtual printer as the "current" printer, a script now has to use Mac OS 9's Desktop printing scripting:
 set default printer to desktop printer "Virtual Printer" 

Then the script can tell InDesign to print using a specific printer: 

print document 1 print dialog no using "My Printer Style 2" 

-peter
Technical Details
Message-ID: <ef88bae.3@WebX.aaQKaf7vad4>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!priapus.visi.com!news-out.visi.com!hermes.visi.com!news.stealth.net!news.stealth.net!news.imp.ch!news.imp.ch!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <ef88bae.-1@WebX.aaQKaf7vad4>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,aa22258446d4b9e2
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-05-19 20:37:46 PST
From: "Peter Boctor" <peter.boctor@adobe.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!207.217.77.43.MISMATCH!newsfeed1.earthlink.net!newsfeed.earthlink.net!priapus.visi.com!news-out.visi.com!hermes.visi.com!news.stealth.net!news.stealth.net!news.imp.ch!news.imp.ch!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Printing Postscript from script
Message-ID: <ef88bae.3@WebX.aaQKaf7vad4>
Date: Sun, 19 May 2002 20:23:29 -0700
References: <ef88bae.-1@WebX.aaQKaf7vad4>
Lines: 54
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit