🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18290

Change the font of characters (AS)

#18290
From: Olivier Berquin
Date: Wed, 16 Apr 2003 07:25
28 lines
1564 bytes
Hello fellows scripters

I would like to change the font of every characters from the first character
of the paragraph "i" thru the first "tab" of the paragraph "i".
I wrote the script below, but I wonder if anybody known an other method.
This one is a little bit slow. It takes +- 7 secondes for 19 paragraphs.
I would like to work with a story of +- 1400 paragraphs !



 
tell document 1 of application "InDesign 2.0.2" 
	tell story 1 
		repeat with i from 1 to count of paragraphs 
			set myOffsetofFirstChar to (index of the first character of paragraph i) 
			set myIndexofFirstTab to (index of the first character of paragraph i whose contents = "	")

			set properties of (characters myOffsetofFirstChar thru myIndexofFirstTab) to {applied font:"Times", font style:"Bold"} 
		end repeat 
	end tell 
end tell 




TIA

Olivier.
Technical Details
Message-ID: <1de8bfdc.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,f7431b34e5085098,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-04-16 00:37:54 PST
From: "Olivier Berquin" <olb@microscript.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Change the font of characters (AS)
Message-ID: <1de8bfdc.-1@WebX.la2eafNXanI>
Date: Wed, 16 Apr 2003 00:25:44 -0700
Lines: 30
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit