[OS X TeX] Multiple Search/Replace in one script?

Maarten Sneep maarten.sneep at xs4all.nl
Sun Jun 3 19:04:12 EDT 2007


On Jun 3, 2007, at 15:18, Steffen Wolfrum wrote:

> Hi Maarten,
>
> thanks for the great help. Looks very clean and useful!
>
> On Wed, 30 May 2007 19:49:43 +0200, Maarten Sneep wrote:
>> Some items ccan be grouped:
>>
>> tell application "TextWrangler"
>> 	set searchoptions to search mode:literal, starting at top:false,
>> wrap around:false, backwards:false, case sensitive:false, match
>> words:false, extend selection:false}
>> 	replace "1. Dezember" using "1.\\,Dezember" searching in text 1 of
>> text document 1 options searchoptions
>> 	replace "daß" using "dass" searching in text 1 of text document 1
>> options searchoptions
>> 	replace "(\\.) (Dezember|Oktober|Januar|Mai)" using "\\01\\\\,\\02"
>> searching in text 1 of text document 1 options searchoptions
>> end tell
>
>
> Two more question, please:
> Did you miss an opening bracket somewhere in the line "set  
> searchoptions to ...}"?

yes, copy and paste error. Do the recording, and the correct syntax  
will be obvious.

> Is it also possible to write an alternative set of options, like  
> "set alternative_searchoptions" below?

Yes,

set searchoptions to {...}
copy searchoptions to alt_searchoptions
set match words of alt_searchoptions to false

(not tested)

M
------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the MacOSX-TeX mailing list