Article View: adobe.scripting.indesign
Article #16330Re: [VB] Creating threaded Textframes
From: Guy Verville
Date: Thu, 25 Sep 2003 12:22
Date: Thu, 25 Sep 2003 12:22
64 lines
3135 bytes
3135 bytes
Character styles will also work. I was thinking of an inline frame because
I wanted an unique label for each footnote frame
This is not necessary in this case. The code is as follow for my renumbering footnotes script:
Dim i, j, k, starteur, starteur2
Const AppelNote = "AppelNote"
Const ChiffreNote = "ChiffreNote"
Set myindesign = CreateObject("InDesign.Application.2.0")
Set MyDoc = myindesign.ActiveDocument
' clears find preferences
myindesign.FindPreferences = idNothing
myindesign.ChangePreferences = idNothing
' checks if "AppelNote" or "ChiffreNote" exists.
' AppelNote is the name of the characteur style
' I use to place my footnote number in text
] If MyDoc.CharStyles.Count > 0 Then
]] For i = 1 To MyDoc.CharStyles.Count
]]] Select Case MyDoc.CharStyles.Item(i)
]]]] Case AppelNote
]]]]] j = 1
]]]] Case ChiffreNote
]]]]] k = 1
]]] End Select
]] Next
] End If
If j = 0 Or k = 0 Then
MsgBox ("Please make sure you have the necessary CharacterStyle set in your
pub.") Else
] 'Loops through the pages
]] For k = 1 To MyDoc.Pages.Count
]]] Set mypage = MyDoc.Pages.Item(k)
]]] Loops the Textframes
]]] For j = 1 To mypage.TextFrames.Count
]]]] Set myTSRs = mypage.TextFrames.Item(j).TextStyleRanges
]]]]' Loops through the TextStyleRanges
]]]] For i = 1 To myTSRs.Count
]]]]] Finds "AppelNote" and "ChiffreNote"
]]]]] With myTSRs.Item(i)
]]]]]] test = .CharacterStyle
]]]]]] Select Case .CharacterStyle
]]]]]]] Case AppelNote
]]]]]]]] starteur = starteur + 1
]]]]]]]] .TextContents = LTrim(starteur)
]]]]]]] Case ChiffreNote
]]]]]]]] starteur2 = starteur2 + 1
]]]]]]]] .TextContents = LTrim(starteur2) & "."
]]]]]] End Select
]]]]] End With
]]]] Next
]]] Next
]] Next
if strateur <> starteur2 then MsgBox "Please verify your footnotes, They
don't match!!!"
MsgBox ("Finish")
End If
This is perhaps not the best method since NOTHING must be set in those CharacterStyles because if they are, they will be overriden by a figure the next time the script will be called. But, after some months using it, it helped me a lot with my work. Now, with your help, I'm going to the next level of formatting, placing at once all the Textframes needed! Third step, place those TextFrames at the right place, calculate the desired height to contain the Footnotes present in a page.
Technical Details
Message-ID:
<2ccd84de.6@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccd84de.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,fa086e7e41e88830 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-09-25 05:37:42 PST From: "Guy Verville" <taddeus@spamcop.net> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!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: Re: [VB] Creating threaded Textframes Message-ID: <2ccd84de.6@webx.la2eafNXanI> Date: Thu, 25 Sep 2003 05:22:07 -0700 References: <2ccd84de.-1@webx.la2eafNXanI> Lines: 68 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit