Article View: adobe.scripting.indesign
Article #17376A little script to create guides for a book cover
From: Guy Verville
Date: Mon, 16 Jun 2003 00:48
Date: Mon, 16 Jun 2003 00:48
53 lines
2836 bytes
2836 bytes
For those who might be interested, here's a little VBScript that you can save in a *.vbs file and place it in your script folder. It's pretty easy to understand and you can play with the settings a lot. It's crude, but efficient to make a book cover.
Set myIndesign = CreateObject("InDesign.Application.2.0")
Set MyDoc = myIndesign.documents.add
'Asks for the dimensions of the book and the spine
BookWidth=CDbl(InputBox("Enter the width of the book in inches","Width of the book","6"))
BookHeight=CDbl(InputBox("Enter the height of the book in inches","Height of the book","9"))
BookSpine=CDbl(InputBox("Enter the spine of the book in inches","Spine of the book","1"))
BookTotalWidth=BookWidth*2 +BookSpine
'You can modify here to the measurementUnits of your choice.
With MyDoc
.ViewPreferences.HorzMeasurementUnits= idMSInches
.ViewPreferences.VertMeasurementUnits =idMSInches
.DocumentPreferences.PageWidth=BookTotalWidth
.DocumentPreferences.PageHeight=BookHeight
.Pages.Item(1).MarginPreferences.MarginLeft=0
.Pages.Item(1).MarginPreferences.MarginRight=0
.Pages.Item(1).MarginPreferences.MarginTop=0
.Pages.Item(1).MarginPreferences.MarginBottom=0
End With
Set myWindow = myInDesign.ActiveWindow
Set mySpread = myWindow.ActiveSpread
Set myGuides = mySpread.Guides
'Creates guides. The sub is set below
CreateAGuide idVertical, -.125
CreateAGuide idVertical, 0
CreateAGuide idVertical, .5
CreateAGuide idVertical, BookWidth - .5
CreateAGuide idVertical, BookWidth
CreateAGuide idVertical, BookWidth + BookSpine
CreateAGuide idVertical, BookWidth + BookSpine + .5
CreateAGuide idVertical, BookTotalWidth - .5
CreateAGuide idVertical, BookTotalWidth
CreateAGuide idVertical, BookTotalWidth + .125
CreateAGuide idHorizontal, -.125
CreateAGuide idHorizontal, 0
CreateAGuide idHorizontal, .25
CreateAGuide idHorizontal, BookHeight - .25
CreateAGuide idHorizontal, BookHeight
CreateAGuide idHorizontal, BookHeight + .125
Sub CreateAGuide(Orientation,Placement)
Set myGuide = myGuides.add
With myGuide
.GuideOrientation =Orientation
.GuideLocation=Placement
End With
End Sub
Technical Details
Message-ID:
<1de98c1f.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,ff1d3d85b5681512,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-06-15 18:08:09 PST From: "Guy Verville" <taddeus@spamcop.net> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: A little script to create guides for a book cover Message-ID: <1de98c1f.-1@WebX.la2eafNXanI> Date: Sun, 15 Jun 2003 17:48:32 -0700 Lines: 59 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit