Article View: adobe.scripting.indesign
Article #15852Re: search with wildcards not working properly in AppleScript
From: Olav_Kvern
Date: Sat, 08 Nov 2003 00:42
Date: Sat, 08 Nov 2003 00:42
45 lines
2068 bytes
2068 bytes
Shane--
That works great! So, Ton, here's a better version:
--FindChangeBullets.as
--An InDesign CS AppleScript
--Set myMakeExample to false to find/change text in
--the active document, or set it to true to generate an
--example document to demonstrate the script.
set myMakeExample to true
tell application "InDesign CS"
set find preferences to nothing
set change preferences to nothing
if myMakeExample = true then
set myString to "First paragraph.
z First bulleted paragraph.
x Second bulleted paragraph.
z Third bulleted paragraph.
x Fourth bulleted paragraph.
x Fifth bulleted paragraph.
x Sixth bulleted paragraph.
x Seventh another bulleted paragraph.
z Eighth bulleted paragraph.
x Ninth another bulleted paragraph.
x Tenth another bulleted paragraph.
x Eleventh another bulleted paragraph.
x Twelfth another bulleted paragraph.
k Thirteenth another bulleted paragraph."
set myDocument to make document
tell page 1 of myDocument
set myTextFrame to make text frame with properties {geometric bounds:{"6p", "6p", "36p", "36p"}, contents:myString}
end tell
else
set myDocument to active document
end if
tell stories of myDocument
set character 1 of (every paragraph where character 2 = "\t") to "<2019>"
end tell
end tell
Thanks,
Ole
Technical Details
Message-ID:
<2ccdefcd.7@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccdefcd.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,31b95e11472f0fd8 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-11-07 17:07:49 PST From: Olav_Kvern@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: search with wildcards not working properly in AppleScript Message-ID: <2ccdefcd.7@webx.la2eafNXanI> Date: Fri, 7 Nov 2003 16:42:09 -0800 References: <2ccdefcd.-1@webx.la2eafNXanI> Lines: 44 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit