🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17347

Re: Script to print pages

#17347
From: Johannes Buchmann
Date: Thu, 12 Jun 2003 18:14
88 lines
3527 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])


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
Dim strFileName as String
'Need to set Path to whatever here...
StrFileName = "e:\Data\DigiPDF\" & Split(objDoc.Name, ".")(0) & ".pdf"
  Set objDoc = m_appInDesign.Open(strFileName)
  objDoc.Export InDesign.idExportFormat.idExportPDF, strFileName, False,
m_appInDesign.PDFExportStyles.Item("[eBook]")

  objDoc.Close InDesign.idSaveOptions.idDoNotSaveChanges
End Sub

"Luis Oliveira" <lpoliveira@mail.telepac.pt> schrieb im Newsbeitrag
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: <773DBB271438B35C0CF41C11A84B2C80@in.WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!38.144.126.70.MISMATCH!feed3.newsreader.com!newsreader.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!out.nntp.be!propagator2-sterling!news-in.nuthinbutnews.com!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <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-12 11:38:05 PST
From: "Johannes Buchmann" <johannesbuchmann@hotmail.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!38.144.126.70.MISMATCH!feed3.newsreader.com!newsreader.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!out.nntp.be!propagator2-sterling!news-in.nuthinbutnews.com!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Script to print pages
Message-ID: <773DBB271438B35C0CF41C11A84B2C80@in.WebX.la2eafNXanI>
Date: Thu, 12 Jun 2003 11:14:17 -0700
References: <1de96a17.-1@WebX.la2eafNXanI>
Lines: 90
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2727.1300
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit