🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9658

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

#9658
From: Fred_Goldman
Date: Thu, 20 Jul 2006 02:09
18 lines
1829 bytes
I'm at a loss over here. I'm almost positive that this script was working perfectly on my test document. Now when I try to run it (even on the test document) it leaves out the last letter in the character style. Here's the script:

myDoc = app.activeDocument
myOriginalStyle = app.activeDocument.characterStyles.item("[None]");
myFinalStyle = app.activeDocument.paragraphStyles.item("Paragraph Style 1");
myCstyle = myDoc.characterStyles.itemByName("Mekor");
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].paragraphs[0].words[3].insertionPoints[0].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()
}
Technical Details
Message-ID: <3bc0ed94.15@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.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: Fred_Goldman@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Re: Variation of Dave's Script in "How To Begin Scripting"
Message-ID: <3bc0ed94.15@webcrossing.la2eafNXanI>
Date: Wed, 19 Jul 2006 19:09:53 -0700
References: <3bc0ed94.-1@webcrossing.la2eafNXanI>
Lines: 24
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!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeed.freenet.de!news.albasani.net!news.ecp.fr!news.stben.net!webcrossing