Article View: adobe.scripting.indesign
Article #2547Re: Apply a noBreak with javascript
From: Peter Kahrel
Date: Wed, 10 Dec 2008 19:54
Date: Wed, 10 Dec 2008 19:54
14 lines
1286 bytes
1286 bytes
nilom,
There's nothing wrong with your regular expression, it works fine, though you make things unnecessarily complicated. You might as well use this one:
var myfound = txt.match( /(� [\d.,]+)/g );
which does the same. But the reason why it doesn't work is that with your regular expression you collect an array (myfound), and then apply something to that array -- apply noBreak. This has no effect on the array at all (because noBreak is relevant to InDesign objects, not to arrays of strings), and your InDesign document is unaffected.
Before we go on it is useful to know which version of InDesign you use (CS 2, 3, or 4).
Peter
Technical Details
Message-ID:
<59b73c29.0@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossingReferences:
<59b73c29.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,6abd8a76c8452b2c X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII From: "Peter Kahrel" <kahrel@kahrel.plus.com> Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Apply a noBreak with javascript Message-ID: <59b73c29.0@webcrossing.la2eafNXanI> Date: Wed, 10 Dec 2008 11:54:09 -0800 References: <59b73c29.-1@webcrossing.la2eafNXanI> Lines: 17 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit