Article View: adobe.scripting.indesign
Article #16092Re: "Bolding" all words before hyphen in classifieds...advice please?
From: Dave_Saunders
Date: Wed, 15 Oct 2003 12:23
Date: Wed, 15 Oct 2003 12:23
26 lines
2051 bytes
2051 bytes
Some usage notes: 1. If there's more than one em-dash in a paragraph, the script will bold up to the last em-dash, which is probably not what you want. If you need to deal with this, set up a variable call oldStart and add immediately before the repeat with myEm statement: set oldStart to 0 and then add replace the set applied character style statement with: if myStart is not equal to oldStart then set oldStart to myStart set applied character style of characters myStart through myEnd of myStory to character style "Bold" of document 1 end if With that change, the script will operate only up to the first em-dash in any paragraph. 2. If you have a paragraph in one of the identified styles that starts with an em-dash, then the return at the end of the previous paragraph is what actually would be boldened. 3. If the first paragraph in a story is in one of the identified styles AND it starts with an em-dash, you'll get an error. 4. If any of the listed paragraph style names doesn't exist (be careful about case; paragraph style names are case sensitive), you'll get an error. 5. If a paragraph exists in one of the styles but doesn't have an em-dash, the paragraph will be ignored, no bolding will be applied to it. Dave
Technical Details
Message-ID:
<2ccddd2c.4@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccddd2c.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,b3734101a930c616 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-10-15 05:38:18 PST From: Dave_Saunders@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: "Bolding" all words before hyphen in classifieds...advice please? Message-ID: <2ccddd2c.4@webx.la2eafNXanI> Date: Wed, 15 Oct 2003 05:23:06 -0700 References: <2ccddd2c.-1@webx.la2eafNXanI> Lines: 36 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit