Article View: adobe.scripting.indesign
Article #19938Re: Search/replace -> Unexpected Quit
From: Steve Nichols
Date: Wed, 06 Nov 2002 22:18
Date: Wed, 06 Nov 2002 22:18
84 lines
2441 bytes
2441 bytes
I posted the search - replace - bomb thread and Shane came up with a workaround for that involved a whose clause the may be of some help... the script is something I use for a particular writer that I have not been able to educate:
tell application "InDesign 2.0.1"
set find preferences to nothing
set change preferences to nothing
tell active document
repeat
try
set myfoundspaces to search for " " replacing with " "
if myfoundspaces = {} then
exit repeat
end if
on error
exit repeat
end try
end repeat
end tell
tell active document
repeat
try
set myFoundparas to search for "^p. " replacing with "^pīŋŊ^t"
if myFoundparas = {} then
exit repeat
end if
on error
exit repeat
end try
end repeat
end tell
tell active document
repeat
try
set myFoundtabs to search for "^t^t" replacing with "^t"
if myFoundtabs = {} then
exit repeat
end if
on error
exit repeat
end try
end repeat
end tell
tell active document
repeat
try
set myFoundparatab to search for "^p^t" replacing with "^p"
if myFoundparatab = {} then
exit repeat
end if
on error
exit repeat
end try
end repeat
end tell
tell active document
repeat
try
set myFoundparaspace to search for "^p " replacing with "^p"
if myFoundparaspace = {} then
exit repeat
end if
on error
exit repeat
end try
end repeat
end tell
tell active document
delete (every paragraph of every story whose contents = return)
end tell
end tell
Technical Details
Message-ID:
<1de67b0b.3@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de67b0b.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,3b5006219fe32cc X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-11-06 14:40:02 PST From: "Steve Nichols" <steve@lasersedge.com.au> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Search/replace -> Unexpected Quit Message-ID: <1de67b0b.3@WebX.la2eafNXanI> Date: Wed, 6 Nov 2002 14:18:05 -0800 References: <1de67b0b.-1@WebX.la2eafNXanI> Lines: 82 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit