Article View: adobe.scripting.indesign
Article #17488Re: Script to print pages
From: johannes
Date: Fri, 06 Jun 2003 11:41
Date: Fri, 06 Jun 2003 11:41
88 lines
3361 bytes
3361 bytes
hi,
heres what may help you - i could use this today anyway, so a script
for that is a good idea...
functions expect full paths as String - so - i da this with a form -
but it should work hardcoded as well...
as you see this exports to pdf (change the hardcoded output path!)- if
you like to print ...
uhm just replace the export line:
objDoc. PrintOut( InDesign.idPrintOptions.idPrintWithoutDialog
,[XXName Of Printer StyleXX])
(sorry but this form adds line breaks to the code - so you'll need
remove some of them - hope i could help you i a way - if not i can
mail vb files to you)
J.
-------------------------------------------------------
Option Explicit
Public m_appInDesign As Object
Public m_vntFS As Variant
Public Sub printDir(strDir)
Set m_appInDesign = CreateObject("InDesign.Application")
Set m_vntFS = CreateObject("Scripting.FileSystemObject")
Dim objDir, objFiles, objFile As Variant
Dim i As Integer
Dim strSuffix, strPath As String
Set objDir = m_vntFS.GetFolder(strDir)
For Each objFile In objDir.Files
strPath = objFile.Path
strSuffix = Split(strPath, ".")(1)
If strSuffix = "indd" Then
printFile objFile.Path
End If
Next
End
End Sub
Public Sub printBook(strBookFile)
Set m_appInDesign = CreateObject("InDesign.Application")
Set m_vntFS = CreateObject("Scripting.FileSystemObject")
Dim objDir, objFiles, objFile As Variant
Dim i, ii As Integer
Dim strSuffix, strPath As String
Dim objDoc As Object
strSuffix = Split(strBookFile, ".")(1)
If strSuffix = "indb" Then
Set objDoc = m_appInDesign.Open(strBookFile)
For ii = 1 To objDoc.BookContents.Count
printFile (objDoc.BookContents.Item(ii).FullName)
Next
End If
MsgBox "Done."
End
End Sub
Private Sub printFile(strFileName)
Dim objDoc As Object
Set objDoc = m_appInDesign.Open(strFileName)
objDoc.Export InDesign.idExportFormat.idExportPDF,
"e:\Data\DigiPDF\" & Split(objDoc.Name, ".")(0) & ".pdf", False,
m_appInDesign.PDFExportStyles.Item("[eBook]")
objDoc.Close InDesign.idSaveOptions.idDoNotSaveChanges
End Sub
"Luis Oliveira" <lpoliveira@mail.telepac.pt> wrote in message news:<1de96a17.-1@WebX.la2eafNXanI>...
> Hi,
>
> I'm not very familiar with VB scripting, so i'm thinking someone as already developed a script to print pages that are on a specified folder automatically without user intervention. Does someone have a script or a piece of code to do this.
>
> Thanks
Technical Details
Message-ID:
<e553fe8f.0306060341.2ad4d5dd@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailReferences:
<1de96a17.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,83e544207eba7d74 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-06-06 04:41:33 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: johannesbuchmann@hotmail.com (johannes) Newsgroups: adobe.scripting.indesign Subject: Re: Script to print pages Date: 6 Jun 2003 04:41:33 -0700 Organization: http://groups.google.com/ Lines: 88 Message-ID: <e553fe8f.0306060341.2ad4d5dd@posting.google.com> References: <1de96a17.-1@WebX.la2eafNXanI> NNTP-Posting-Host: 192.129.25.10 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1054899693 14545 127.0.0.1 (6 Jun 2003 11:41:33 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 6 Jun 2003 11:41:33 GMT