🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #20395

Re: AppleScripting Find/Change in InDesign

#20395
From: JonDot
Date: Mon, 29 Jul 2002 16:07
27 lines
2146 bytes
Dave, 

Thanks for the tip. I was a little surprised that I had to end the TELL on the search for the "/" before I made the character style changes, but if I didn't, the program would crash every time. 

Here's what I ended up with: 

tell application "InDesign 2.0.1" 
	set find preferences to nothing 
	set change preferences to nothing 
	tell document 1 
		search with find attributes {find text:"/"} with change attributes {change text:"/"} 
	end tell 
	set find preferences to nothing 
	set change preferences to nothing 
	tell document 1 
		set theStyle to character style "Superscript" 
		search with find attributes {find text:"^9^9/"} with change attributes {applied character style:theStyle} 
		search with find attributes {find text:"^9/"} with change attributes {applied character style:theStyle} 
		set theStyle to character style "Subscript" 
		search with find attributes {find text:"/^9^9"} with change attributes {applied character style:theStyle} 
		search with find attributes {find text:"/^9"} with change attributes {applied character style:theStyle} 
		set theStyle to character style "Virgule" 
		search with find attributes {find text:"/"} with change attributes {applied character style:theStyle} 
	end tell 
end tell 

Thanks for your help!
Technical Details
Message-ID: <ef9e366.1@WebX.aaQKaf7vad4>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!64.152.100.70.MISMATCH!ps01-sjc1!newsfeeds-atl2!newsfeeds-atl1.usenetserver.com!news.webusenet.com!news-hub.cableinet.net!blueyonder!btnet-peer!btnet!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <ef9e366.-1@WebX.aaQKaf7vad4>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,fd9f8b93875eae15
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2002-07-29 09:41:25 PST
From: JonDot <jondot@attbi.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-04!supernews.com!64.152.100.70.MISMATCH!ps01-sjc1!newsfeeds-atl2!newsfeeds-atl1.usenetserver.com!news.webusenet.com!news-hub.cableinet.net!blueyonder!btnet-peer!btnet!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: AppleScripting Find/Change in InDesign
Message-ID: <ef9e366.1@WebX.aaQKaf7vad4>
Date: Mon, 29 Jul 2002 09:07:43 -0700
References: <ef9e366.-1@WebX.aaQKaf7vad4>
Lines: 35
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit