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

Steffen Wolfrum mactex_aa at st.estfiles.de
Sun Jun 3 15:18:49 CEST 2007


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 ...}"?
Is it also possible to write an alternative set of options, like "set alternative_searchoptions" below?


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}
	set alternative_searchoptions to case sensitive:true
	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


Steffen

------------------------- 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 macostex-archives mailing list