🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18258

Re: Delete text/runin problem

#18258
From: Olivier Berquin
Date: Fri, 11 Apr 2003 07:11
31 lines
1643 bytes
Kari,

1) Are you sure that in your story, there is not an other colon
(something like "And he said: the weather is nice this evening")?
That seems dangerous to me to erase text without requiring the opinion of the user.

2) Why a loop for deleting space(s) after colon? In general, I HATE multiple spaces in a document !!! My teacher is a typograph !
So, you can make a search for spaces and replace with one space in your document. After that, you can do something like this:



 
tell application "InDesign 2.0.2" 
	tell parent story of selection 
		repeat with i from 1 to count of paragraphs 
			try 
				set contents of text from character 1 to (character 1 whose contents = ":") of paragraph i to "" 
			end try 
			try 
				set contents of text from character 1 to (character 1 whose contents = " ") of paragraph i to "" 
			end try 
		end repeat 
	end tell 
end tell 




Hope that helps !

Olivier.
Technical Details
Message-ID: <1de8a741.9@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de8a741.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,fb1e447d7f4ef9dc
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-04-11 00:37:56 PST
From: "Olivier Berquin" <olb@microscript.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Delete text/runin problem
Message-ID: <1de8a741.9@WebX.la2eafNXanI>
Date: Fri, 11 Apr 2003 00:11:44 -0700
References: <1de8a741.-1@WebX.la2eafNXanI>
Lines: 32
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit