🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9684

Re: Variation of Dave's Script in "How To Begin Scripting"

#9684
From: Dave_Saunders
Date: Thu, 20 Jul 2006 15:25
19 lines
1450 bytes
First, how to adjust the reference:

myStory = myFinds[j].parentStory
start = myFinds[j].characters[0].index + 1;
end = myFinds[j].characters[-1].index + 1;
myText = myStory.characters.itemByRange(start, end).texts[0];

Next how to put the anchor at the end and then move it:

for (var j = myFinds.length - 1; j >= 0; j--) {
myLoc = myFinds[j].paragraphs[0].words[3].insertionPoints[0];
myTF = myFinds[i].parentStory.insertionPoints[-1].addAnchor();
// You should move the text into the frame immediately, not in a separate loop
myStory.characters[-1].move(LocationOptions.before, myLoc)
}

I've written that off the top of my head, but I think it will work. There might be a problem if the end of the story is overset. I never thought about that when writing addAnchor();

Dave
Technical Details
Message-ID: <3bc0ed94.20@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.musoftware.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing
References: <3bc0ed94.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,c3f000112de732ba
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Dave_Saunders@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Re: Variation of Dave's Script in "How To Begin Scripting"
Message-ID: <3bc0ed94.20@webcrossing.la2eafNXanI>
Date: Thu, 20 Jul 2006 08:25:02 -0700
References: <3bc0ed94.-1@webcrossing.la2eafNXanI>
Lines: 22
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!news.musoftware.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing