🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #19516

Apply character style to certain characters in certain paragraphs?

#19516
From: Kari Puikkonen
Date: Sat, 14 Dec 2002 13:29
46 lines
1845 bytes
Hou!

I try to apply character style to all characters before ":" in chosen paragraph.

I thought one of these would work, but no:



tell application "InDesign 2.0.2" 
	tell document 1 
		set charStyle to character style "Kirjallisuus nimet" 
		set ParaStyle to paragraph style "ki" 
		tell parent story of selection 
			try 
				set applied character style of text from character 1 to  
(character 1 whose contents = ":") of ParaStyle to charStyle 
			on error 
				try 
					set applied character style of text from character 1 to  
(character 1 whose contents = "?") of ParaStyle to charStyle 
				end try 
			end try 
		end tell 
	end tell 
end tell



and



tell application "InDesign 2.0.2" 
	tell document 1 
		set theStyle to paragraph style "ki" 
		set charStyle to character style "Kirjallisuus nimet" 
		set applied character style of text from character 1 to  
(character 1 whose contents = ":") of (every paragraph of every story whose applied paragraph style is theStyle) to charStyle 
	end tell 
end tell



Can anybody enlighten me?

Kari
Technical Details
Message-ID: <1de70177.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newspump.sol.net!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!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,9795ba63ba0468bb,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-12-14 05:38:05 PST
From: "Kari Puikkonen" <kari.puikkonen@welho.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newspump.sol.net!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Apply character style to certain characters in certain paragraphs?
Message-ID: <1de70177.-1@WebX.la2eafNXanI>
Date: Sat, 14 Dec 2002 05:29:08 -0800
Lines: 40
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit