Article View: adobe.scripting.indesign
Article #18051Re: [VB] Placing Multiple Images into set templates
From: Brian Boyce
Date: Fri, 25 Apr 2003 17:39
Date: Fri, 25 Apr 2003 17:39
51 lines
2233 bytes
2233 bytes
Everyone,
Thank you for your help! I've finally gotten it working!
Here's a VBScript to place multiple images into a preset template:
Dim InD
Set InD = CreateObject("InDesign.Application.2.0")
If InD.Documents.Count <> 0 Then
Set InDWindow = InD.ActiveWindow
Set InDSpread = InDWindow.ActiveSpread
Set InDDocument = InD.ActiveDocument
Set InDPage = InDDocument.Pages.Item(1)
' This declares the image name format
ImgName = "img.tif"
ImgNumber = 1
' This line declares the frame label format
LabelName = "img"
LabelNumber = 1
' This line creates the variable for how many images to place,
' and also how many times to loop the placement.
InDHowMany = InputBox("How many images do you want placed into the composite?", "Composite Image Count", "2")
' This begins the looping placement script
For InDPlaceCount = 1 to InDHowMany
' Call names in the FOR statement
InDFrameName = LabelName & LabelNumber
InDImageName = ImgNumber & ImgName
Set InDRec = InDDocument.Rectangles.Item(InDFrameName)
' Place Image Statement
Set InDPlaced = InDRec.Place("Q:\PROJECTS\script test\" & InDImageName)
InDRec.Fit(idCenterContent)
InDRec.Fit(idProportionally)
' This should cause the label and image numbers to progress
ImgNumber = ImgNumber + 1
LabelNumber = LabelNumber + 1
Next
' End of Script
Else
MsgBox "Please open a document and try again."
End If
Technical Details
Message-ID:
<1de8dd3e.11@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!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!newsfeed.telusplanet.net!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de8dd3e.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,458bf860275b79ec X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-04-25 11:07:50 PST From: "Brian Boyce" <promithius@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!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!newsfeed.telusplanet.net!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: [VB] Placing Multiple Images into set templates Message-ID: <1de8dd3e.11@WebX.la2eafNXanI> Date: Fri, 25 Apr 2003 10:39:23 -0700 References: <1de8dd3e.-1@WebX.la2eafNXanI> Lines: 52 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit