🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9532

Re: [JS] Inserting frameBreak

#9532
From: Eric
Date: Thu, 17 Aug 2006 02:19
16 lines
1405 bytes
Okay guys, had to do a bunch of returns to forced line breaks tonight in Applescript. So for the record, here's a way...



set myText to "" & contents of selection 
--The key to speed is to use an "every ... whose" clause to make a list of characters to replace! 
if myText contains return then 
	set myReturnList to {} & (index of every character of selection whose contents = return) 
	repeat with i from 1 to length of myReturnList 
		set character (item i of myReturnList) of selection to forced line break 
	end repeat 
end if



Hope this saves time for anyone having to tackle this in AS. I wasted a couple hours getting to this point from the thing that SHOULD work but doesn't (ie, search selection for return replacing with forced line break). :-\
Technical Details
Message-ID: <3bc10adb.7@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news2.google.com!news.germany.com!news.ecp.fr!news.stben.net!webcrossing
References: <F10F6361F98332BE7A6B2AEE85BAC76D@in.webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,ef64a0db0c086a26,start
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Eric_@_MCA@adobeforums.com
Newsgroups: adobe.scripting.indesign
Subject: Re: [JS] Inserting frameBreak
Message-ID: <3bc10adb.7@webcrossing.la2eafNXanI>
Date: Wed, 16 Aug 2006 19:19:43 -0700
References: <F10F6361F98332BE7A6B2AEE85BAC76D@in.webcrossing.la2eafNXanI>
Lines: 14
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news2.google.com!news.germany.com!news.ecp.fr!news.stben.net!webcrossing