🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1574

Re: CS3 Javascript - finding the paragraph which contain the index page reference

#1574
From: SCUBILION_fr�re
Date: Fri, 30 Jan 2009 20:32
20 lines
1586 bytes
Hello,
I'm French user of Indesign CS3. Please, be forgiving for my poor English.
'b I've a problem when I try to get the index of a line in a Story.
Dim myindesign As InDesign.Application

Dim maselection As InDesign.Story
    Dim mydocument As InDesign.Document
    Set myindesign = CreateObject("InDesign.Application.CS3")
    Set mydocument = myindesign.ActiveDocument
    Set maselection = myindesign.Selection(1).ParentStory
    myindesign.FindGrepPreferences = idNothingEnum.idNothing
myindesign.ChangeGrepPreferences = idNothingEnum.idNothing
    myindesign.FindGrepPreferences.FindWhat = "(?<=~b)\u{1,2} \d{1,2}" Set result = maselection.FindGrep(False)

If I try to get the line index of the first result like that :
   myline = result(1).lines(1).index
myline is the index of the insertion point of the first characters of the result !
I can understand Vbscript and javascript code.
Thank you for your help.
fr�re Scubilion
Technical Details
Message-ID: <59b75803.21@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
References: <59b75803.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,4423827cf06ba747
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII
From: SCUBILION_fr�re@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: CS3 Javascript - finding the paragraph
 which contain the index page reference
Message-ID: <59b75803.21@webcrossing.la2eafNXanI>
Date: Fri, 30 Jan 2009 12:32:56 -0800
References: <59b75803.-1@webcrossing.la2eafNXanI>
Lines: 23
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit