Article View: adobe.scripting.indesign
Article #18126[VB] Placing Multiple Images into set templates
From: Brian Boyce
Date: Thu, 24 Apr 2003 20:32
Date: Thu, 24 Apr 2003 20:32
57 lines
2683 bytes
2683 bytes
I'm trying to create a script that will place a certain number of pictures into a pre-made template with frames already labeled.
The amount of pictures is a user-input variable, and I can't quite figure out how to call that variable as the file name and as the label name. Here's my script so far :
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)
InD.ActiveDocument.ViewPreferences.HorzMeasurementUnits = idMSInches
InD.ActiveDocument.ViewPreferences.VertMeasurementUnits = idMSInches
InDMarginL = InDPage.MarginPreferences.MarginLeft
InDMarginT = InDPage.MarginPreferences.MarginTop
InDMarginR = InDDocument.DocumentPreferences.PageWidth - InDPage.MarginPreferences.MarginRight
InDMarginB = InDDocument.DocumentPreferences.PageHeight - InDPage.MarginPreferences.MarginTop
InDWidth = InDDocument.DocumentPreferences.PageWidth
InDHeight = InDDocument.DocumentPreferences.PageHeight
InDImageNumber = InputBox("How many images do you want placed into the composite?", "Composite Image Count", "15")
' For InDCounter = 1 To InDDocument.AllPageItems.Count
' Set InDPageItem = InDDocument.AllPageItems.Item(InDCounter)
'InDFilePattern = "img.tif"
'InDPath = "Q:\PROJECTS\script test\"
'For InDPlaceImage = 1 To InDImageNumber step 1
'InDPlaceFile = InDPlaceImage & InDFilePattern
For InDCounter = 1 To InDDocument.AllPageItems.Count
Set InDPageItem = InDDocument.AllPageItems.Item(InDCounter)
If InDPageItem.Label = "img" & cstr(InDCounter) Then
'If InDPageItem.Label = "img1" Then
InDPageItem.Place("Q:\PROJECTS\script test\1img.tif")
InDPageItem.Fit(idCenterContent)
End If
'Next 'InDCounter Pass
Next 'InDPlaceImage Pass
' End of Script
Else
MsgBox "Please open a document and try again."
End If
thanks for your help!
Brian
Technical Details
Message-ID:
<1de8dd3e.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!eusc.inter.net!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,458bf860275b79ec,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-04-24 13:37:54 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-09!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: [VB] Placing Multiple Images into set templates Message-ID: <1de8dd3e.-1@WebX.la2eafNXanI> Date: Thu, 24 Apr 2003 13:32:33 -0700 Lines: 63 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit