🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #16190

Re: [AS] Get contents of text frame - with style?

#16190
From: Dave_Saunders
Date: Wed, 08 Oct 2003 11:36
11 lines
1517 bytes
Jim,

Get the text into an AppleScript variable, then use Text Style Ranges over the same text to see how the formatting divides. Work backwards through that list to add tags to your text in the AppleScript variable.

But: if any of the text arrives as a unicode string, your indexes will be out of sync.

Might be well to start with a copy of the document and then put your tags into the text before copying it to the AppleScript variable (you're still going to have to assure that any unicode is dealt with properly by whatever downstream processor you're using.

Working backwards allows you to modify the content of text without breaking any references you might have to earlier parts of the same text.

Dave
Technical Details
Message-ID: <2ccdc2e2.4@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webx
References: <2ccdc2e2.-1@webx.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,2258dfe830e0f182
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-10-08 04:37:42 PST
From: Dave_Saunders@adobeforums.com
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.arcor-online.net!newsfeed01.sul.t-online.de!t-online.de!webx
Newsgroups: adobe.scripting.indesign
Subject: Re: [AS] Get contents of text frame - with style?
Message-ID: <2ccdc2e2.4@webx.la2eafNXanI>
Date: Wed, 8 Oct 2003 04:36:40 -0700
References: <2ccdc2e2.-1@webx.la2eafNXanI>
Lines: 18
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit