🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #611

Re: Paragraph Style - Keep Options

#611
From: jongware
Date: Tue, 10 Mar 2009 10:42
19 lines
1445 bytes
The type of the selection matters; keepWithNext is only part of Paragraphs, and your selection may be something else. I tested the type of mySelection using

      alert ("Selection is of type "+mySelection.constructor.name);




and it gave back "InsertionPoint", "Text", "Word" -- ah, finally! If you triple-click a paragraph, only then it returns "Paragraph".

So, check if the type is "Paragraph"; if so, use that, else check the selection's .parent property? Doesn't work. Any parent of text items seem to be "Story".

But there is another interesting property all these text types have in common: they all have "paragraphs" (an array). A quick check using

      mySelection.paragraphs[0].fillTint = 25;




shows that, indeed, you can use this for direct access to 'the selected paragraph'.
Technical Details
Message-ID: <59b82b64.2@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.glorb.com!news2.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossing
References: <59b82b64.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,c0be6b82988d16c5
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!news2.google.com!news.glorb.com!news2.glorb.com!newsfeed.news2me.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Paragraph Style - Keep Options
Message-ID: <59b82b64.2@webcrossing.la2eafNXanI>
Date: Tue, 10 Mar 2009 03:42:45 -0700
References: <59b82b64.-1@webcrossing.la2eafNXanI>
Lines: 20
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit