Article View: adobe.scripting.indesign
Article #8173Re: How to begin scripting?
From: Bruce_Knutzen
Date: Fri, 03 Nov 2006 03:56
Date: Fri, 03 Nov 2006 03:56
20 lines
1663 bytes
1663 bytes
Here is a simple visual basic script for finding oversets. It first tells you how many textframes there are in your document and then searches through your textframes checking for an overset value and if true, takes note of the page the overset is on and moves on to the next textframe. When finished, it displays all the pages that oversets were found on. If there is more than one overset on a page it lists that page multiple times. I have had over 1700 textframes in one 100 page document. The script assumes you have an open document with textframes.
Set myInDesign = CreateObject("InDesign.Application.CS2")
Set myDocument = myInDesign.ActiveDocument
myErrors = ""
msgbox "This document contains " & myDocument.TextFrames.Count & " text frames."
For i = 1 To myDocument.TextFrames.Count
If myDocument.TextFrames.Item(i).OverFlows Then
MyErrors = MyErrors & "Overset on page " & myDocument.TextFrames.Item(i).Parent & Chr(13) & Chr(10)
End If
next
If MyErrors = "" Then
MsgBox "No Oversets Detected"
Else
Msgbox MyErrors
End If
Technical Details
Message-ID:
<3bbd759f.127@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.isoc.lu!webcrossingReferences:
<3bbd759f.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,dd9eb181c1e6fc23 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bruce_Knutzen@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: How to begin scripting? Message-ID: <3bbd759f.127@webcrossing.la2eafNXanI> Date: Thu, 2 Nov 2006 19:56:44 -0800 References: <3bbd759f.-1@webcrossing.la2eafNXanI> Lines: 29 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit