🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9686

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

#9686
From: Fred_Goldman
Date: Thu, 20 Jul 2006 15:28
24 lines
1757 bytes
Yippee I just figured it out!

myDoc = app.activeDocument
myOriginalStyle = app.activeDocument.characterStyles.item("[None]");
myFinalStyle = app.activeDocument.paragraphStyles.item("Paragraph Style 2");
myCstyle = myDoc.characterStyles.itemByName("Side");
app.findPreferences = app.changePreferences = null;
app.findPreferences.appliedCharacterStyle = myCstyle;
myFinds = myDoc.search("", false, false, undefined, {appliedCharacterStyle:myCstyle} );
for (var j = myFinds.length - 1; j >= 0; j--) {
myTF = myFinds[j].insertionPoints[-1].addAnchor();
// theText.move(LocationOptions.atEnd, myTF.parentStory);
myAnchStory = myTF.parentStory;
  myFinds[j].move(LocationOptions.atEnd, myAnchStory);
  myAnchStory.texts[0].applyStyle( myOriginalStyle );
  myAnchStory.texts[0].applyStyle( myFinalStyle,true );
  myAnchStory.recompose()
}
app.findPreferences = app.changePreferences = null;
 myFinds2 = myDoc.search("^a", false, false, undefined, );
 for (var i = myFinds2.length - 1; i >= 0; i--) {
 myLocation = myFinds2[i].paragraphs[0].words[3];
 myFinds2[i].move(LocationOptions.atEnd, myLocation)
 }
Technical Details
Message-ID: <3bc0ed94.21@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!syros.belnet.be!news.belnet.be!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: Fred_Goldman@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Re: Variation of Dave's Script in "How To Begin Scripting"
Message-ID: <3bc0ed94.21@webcrossing.la2eafNXanI>
Date: Thu, 20 Jul 2006 08:28:12 -0700
References: <3bc0ed94.-1@webcrossing.la2eafNXanI>
Lines: 26
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!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing