🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18213

Re: Delete text/runin problem

#18213
From: Kari Puikkonen
Date: Tue, 08 Apr 2003 22:42
46 lines
2016 bytes
Dave,

Yes, those syntaxies are quite difficult!
I tried this, but nothing happend...

tell application "InDesign 2.0.2"  
	set myStory to parent story of selection  
	set theLim to count of paragraphs of myStory  
	set theCharacter to ":" as string  
	repeat with x from 1 to theLim  
		try  
			set theStart to index of character 1 of paragraph x of myStory  
			set theEnd to index of character -2 of paragraph x of myStory  
			set theLoc to (index of first character of characters theStart through theEnd of myStory whose contents = theCharacter)  
			try  
				delete (characters (theLoc + 1) through theStart)  
		end try  
	end repeat  
end tell



Jay,

Your approach worked...

tell application "InDesign 2.0.2"  
	set theChangeText to ""  
	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 theChangeText  
			end try  
			set Checkers to character 1 of paragraph i  
			if Checkers is equal to space then  
				delete character 1 of paragraph i  
			end if  
		end repeat  
	end tell  
end tell

...but I'm pretty sure that there must be much more simpler way to do this!

Huh?

Kari
Technical Details
Message-ID: <1de8a741.2@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!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-08 16:07:34 PST
From: "Kari Puikkonen" <kari.puikkonen@welho.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-06!sn-xit-09!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Delete text/runin problem
Message-ID: <1de8a741.2@WebX.la2eafNXanI>
Date: Tue, 8 Apr 2003 15:42:11 -0700
References: <1de8a741.-1@WebX.la2eafNXanI>
Lines: 44
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit