🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #174

Re: Headline caps change for a newspaper

#174
From: jongware
Date: Tue, 31 Mar 2009 09:50
11 lines
1223 bytes
With the changecase function. JS can access individual words in paragraphs, in the following way



for (i=0; i<app.activeDocument.selection[0].paragraphs[0].words.length; i++)

	if (app.activeDocument.selection[0].paragraphs[0].words[i].length > 3)

		app.activeDocument.selection[0].paragraphs[0].words[i].changecase(ChangecaseMode.TITLECASE);

It is restricted to what InDesign counts as 'words' -- a combined word with a hyphen, "two-fold" for example, is taken as two words. Applying your three-letter word rule would yield a headline such as "The Dangers of sun Rays are two-Fold". So some careful post-editing is required.
Technical Details
Message-ID: <59b8751c.0@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
References: <59b8751c.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,dfcd816e9c5a52e6
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: jongware@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Headline caps change for a newspaper
Message-ID: <59b8751c.0@webcrossing.la2eafNXanI>
Date: Tue, 31 Mar 2009 02:50:28 -0700
References: <59b8751c.-1@webcrossing.la2eafNXanI>
Lines: 16
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit