🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #18841

Re: Search & replace in a table [AS]

#18841
From: Olivier Berquin
Date: Wed, 12 Feb 2003 13:13
47 lines
2025 bytes
Yeah !!!

Thanks Shane, you point me to the solution in the thread "'Merge Cells' syntax? [AS]"
This is the script (search a dot and replace by a period in a cell(s) selection)



 
set theSearchString to "." 
set theReplaceString to ","

tell application "InDesign 2.0.2" 
	set mySelection to selection

	if (count mySelection) ? 1 then 
		set myClass to class of item 1 of selection

		if myClass is cell then 
			-- store find/change preferences  
			set myOldFindAttributes to properties of find preferences 
			set myOldChangeAttributes to properties of change preferences 
			-- clear find/change preferences  
			set find preferences to nothing 
			set change preferences to nothing

			set mySelection to cells of selection 
			set cellCount to count of mySelection 
			repeat with myCounter from 1 to cellCount 
				tell item myCounter of mySelection 
					try 
						search for theSearchString replacing with theReplaceString 
					end try 
				end tell 
			end repeat

			-- restore find/change preferences  
			set properties of find preferences to myOldFindAttributes 
			set properties of change preferences to myOldChangeAttributes

		end if 
	end if 
end tell  




Olivier.
Technical Details
Message-ID: <1de7b517.0@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <1de7b517.-1@WebX.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,85157a2bfc88ed82
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-02-12 05:37:58 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-08!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!news.maxwell.syr.edu!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: Search & replace in a table [AS]
Message-ID: <1de7b517.0@WebX.la2eafNXanI>
Date: Wed, 12 Feb 2003 05:13:37 -0800
References: <1de7b517.-1@WebX.la2eafNXanI>
Lines: 45
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit