Article View: adobe.scripting.indesign
Article #19933Re: Converting PM 6.5 Script to ID 2.0
From: Vincent Macaluso
Date: Thu, 14 Nov 2002 23:54
Date: Thu, 14 Nov 2002 23:54
98 lines
4748 bytes
4748 bytes
Ok, now... in a new project (again, with only a single button.. just trying to get the backside working:
I'm trying to look through the guide.. I cant find how to say, set the font, size, color, kerning, etc to myAddressFrame Is that how I would do it? Like, myAddressFrame.Font = "TradeGothic"
Private Sub Command1_Click()
'Open the file for Input
Open "C:\Macaluso-Vincent.TXT" For Input As #1
'Read each line of the text file into the list of variables
'until the end of the file is reached
Do While Not (EOF(1))
Input #1, myFullName, myTitle, myDivision, mySchool, myDept, mySect, myPhone, myFax, myPager, myAddress, myCity, myState, myWeb, myEmail
Loop
'Close the file
Close 1
'Label1.Caption = myFName & FName & age & Addr & City & state & zip
Dim myInDesign
idMSInches = 2053729891
Set myInDesign = CreateObject("InDesign.Application.2.0")
Set myDocument = myInDesign.Documents.Add
Rem Set the measurement units to inches
myDocument.ViewPreferences.HorzMeasurementUnits = idMSInches
myDocument.ViewPreferences.VertMeasurementUnits = idMSInches
Rem Set the page size
myDocument.DocumentPreferences.PageWidth = 8.5
myDocument.DocumentPreferences.PageHeight = 11
Rem Set the page margins to .25 inches
Set myPage = myDocument.Pages.Item(1)
myPage.MarginPreferences.MarginTop = 0.25
myPage.MarginPreferences.MarginLeft = 0.25
myPage.MarginPreferences.MarginBottom = 0.25
myPage.MarginPreferences.MarginRight = 0.25
Rem set up the cut marks on the sides
For myMarkCounter = 1 To 2
If myMarkCounter = 1 Then
myLeftEdge = 0
myRightEdge = 0.125
Else
myLeftEdge = 7.325
myRightEdge = 7.5
End If
For myCounter = 1 To 5
myY = 0.25 + ((myCounter - 1) * 2)
Set myLine = myPage.Lines.Add
myLine.StrokeWeight = 0.25
myLine.StrokeColor = myDocument.Swatches.Item("Registration")
Set myPath = myLine.Paths.Item(1)
myPath.EntirePath = Array(Array(myLeftEdge, myY), Array(myRightEdge, myY))
Next
Next
Rem Set up the cut marks on the top and bottom
For myMarkCounter = 1 To 2
If myMarkCounter = 1 Then
myY1 = 0
myY2 = 0.125
Else
myY1 = 8.325
myY2 = 8.5
End If
For myCounter = 1 To 3
myX = 0.25 + ((myCounter - 1) * 3.5)
Set myLine = myPage.Lines.Add
myLine.StrokeWeight = 0.25
myLine.StrokeColor = myDocument.Swatches.Item("Registration")
Set myPath = myLine.Paths.Item(1)
myPath.EntirePath = Array(Array(myX, myY1), Array(myX, myY2))
Next
Next
Rem Add the text frames to hold the business card content
Set myNameFrame = myPage.TextFrames.Add
myNameFrame.GeometricBounds = Array(0.5, 1.5, 0.75, 3.5)
myNameFrame.TextContents = myFullName
Set myTitleFrame = myPage.TextFrames.Add
myTitleFrame.GeometricBounds = Array(0.75, 1.5, 1, 3.5)
myTitleFrame.TextContents = myTitle
Set myAddressFrame = myPage.TextFrames.Add
myAddressFrame.GeometricBounds = Array(1.25, 1.5, 1.5, 3.5)
myAddressFrame.TextContents = myAddress
Set myPhoneFrame = myPage.TextFrames.Add
myPhoneFrame.GeometricBounds = Array(1.65, 0.25, 1.9, 2.65)
myPhoneFrame.TextContents = myPhone
myGroupArray = Array(myNameFrame, myTitleFrame, myAddressFrame, myPhoneFrame)
Set myGroup = myPage.Groups.Add(, myGroupArray)
Set myNewGroup = myGroup.Duplicate
myNewGroup.Move , Array(0, 2)
Set myNewGroup = myGroup.Duplicate
myNewGroup.Move , Array(0, 4)
Set myNewGroup = myGroup.Duplicate
myNewGroup.Move , Array(0, 6)
Set myGroup = myGroup.Duplicate
myGroup.Move , Array(3.75, 0)
Set myNewGroup = myGroup.Duplicate
myNewGroup.Move , Array(0, 2)
Set myNewGroup = myGroup.Duplicate
myNewGroup.Move , Array(0, 4)
Set myNewGroup = myGroup.Duplicate
myNewGroup.Move , Array(0, 6)
End Sub
Technical Details
Message-ID:
<1de68c0a.21@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!colt.net!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de68c0a.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,ee4c9e7edd2bcb69 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-11-14 16:41:05 PST From: "Vincent Macaluso" <nolageek@yahoo.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-04!supernews.com!news.maxwell.syr.edu!colt.net!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Converting PM 6.5 Script to ID 2.0 Message-ID: <1de68c0a.21@WebX.la2eafNXanI> Date: Thu, 14 Nov 2002 15:54:53 -0800 References: <1de68c0a.-1@WebX.la2eafNXanI> Lines: 105 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit