﻿; Datei mit vordefinierten Batch-Parametern für Suchen & Ersetzen-Alternative für Writer
; für die Erweiterung AltSearch.oxt für OOo Writer
; Zeichenkodierung: UTF-8 
;
; v1.2  7/08
;
; Syntax:
; Zeilen, die nicht mit einer Haupt-Anweisung beginnen, werden ignoriert.
; Haupt-Anweisung müssen in Klammern [] gefasst sein und am Beginn der Zeile stehen.
;  Leerzeichen vor der Haupt-Anweisung sind möglich, alles, was nach der Anweisung folgt, wird als Parameter interpretiert.
; 
;  Beschreibung der Haupt-Anweisungen:
;  [Name] - Batch-Name (bezeichnet als Parameter) - eine einfache Batch-Datei beginnni
;      immer mit dieser Haupt-Anweisung. Das Ende der Batch-Datei wird bestimmt durch die nächste Anweisung
;       [Name] oder [End] für die letze gültige Batch-Datei.
;
;  [Find] - Suchbegriff - wird bei Ausführung der Batch-Datei in das Feld "Suche nach" übertragen.
;
;  [Replace] - Ersetzungs-Begriff - wird bei Ausführung der Batch-Datei in das Feld "Ersetze" übertragen.
;
  [Parameters] - Parameters für Suchen und Ersetzen - leere Zeichenkette setzt alle Parameter aud false,
;      Angabe eines Parameters setzt auf true
;      Mögliche Parameter:  
;           MatchCase  PreserveCapital  WholeWord  ParaStyles  Regular
;           CurrSelection  Backwards  MsgOff  NoSummary  
;
;  [Command] - bestimmt den Ausführungs-Modus von Suchen und Ersetzen -
;      Mögliche Parameter:  Find  FindAll  Replace  ReplaceAll  Count
;
;      
;      
;      Die möglichen Parameter werden bei der weiteren Entwicklung noch erhöht werden
;       
;  [End] - kennzeichnet das Ende der letzen gültigen Batch-Datei - danach folgende Anweisungen werden ignoriert
;      
;
; 

************************************************************
[Name] Hyperlinks lokal auflösen
  [Find][:::HyperLinkURL::]
  [Replace]\h&\h{\u}  \u
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Html [Sel.]	Einfache Umwandlung in Html-Tags für Auswahl    	 
  ; the same parameters for all 
  [Parameters] MsgOff Regular CurrSelection

  ; bold
  [Find][:::CharWeight::]
  [Replace]<b>&</b>
  [Command] ReplaceAll 

  ; italic
  [Find][:::CharPosture::]
  [Replace]<i>&</i>
  [Command] ReplaceAll         	

  ; Hyperlinks 
  [Find][:::HyperLinkURL::]
  [Replace]<a href="\u">&</a>
  [Command] ReplaceAll

  ; Footnotes
  [Find][::Footnote::]
  [Replace]<b><span Title="\o">…<span style="vertical-align: super; font-size: smaller;">\i</span></span></b>
  [Command] ReplaceAll

  ; Add tags of paragraphs 
  [Find]^.*$
  [Replace]<p>&</p>
  [Command] ReplaceAll

  ; Remove redundant ends-starts of identical tags in sequence
  [Find]</i><i>|</b><b>|</p><p>
  [Replace]
  [Command] ReplaceAll



[Name] Text [Sel.]	Convert selected block on the BBcode
   ; the same parameters for all 
  [Parameters] MsgOff Regular CurrSelection

  [Find][:::CharWeight::]
  [Replace][b]&[/b]
  [Command] ReplaceAll

  [Find][:::CharPosture::]
  [Replace][i]&[/i]
  [Command] ReplaceAll

  [Find][:::CharUnderline::]
  [Replace][u]&[/u]
  [Command] ReplaceAll

  [Find][:::CharAutoEscapement=true|CharEscapementHeight=58|CharEscapement=-101::]
  [Replace][sub]&[/sub]\d
  [Command] ReplaceAll

  [Find][:::CharAutoEscapement=true|CharEscapementHeight=58|CharEscapement=101::]
  [Replace][sup]&[/sup]\d
  [Command] ReplaceAll

  [Find][:::HyperLinkURL::]
  [Replace][url=\u]&[/url]
  [Command] ReplaceAll

  [Find][::Picture::]
  [Replace][img]\O[/img]
  [Command] ReplaceAll

  [Find][:::CharFontName=Courier New::]
  [Replace][code]&[/code]
  [Command] ReplaceAll

  ; Remove redundant ends-starts of identical tags in sequence
  [Find]\[/b]\[b]|\[/i]\[i]|\[/u]\[u]|\[/sub]\[sub]|\[/sup]\[sup]|\[/code]\[code]
  [Replace]
  [Command] ReplaceAll
  
  ; code through paragraph  
  [Find]\[/code]\p\[code]
  [Replace]\p
  [Command] ReplaceAll

  ; code through line break  
  [Find]\[/code]\n\[code]
  [Replace]\n
  [Command] ReplaceAll

  ; lists items
  [Find][:::NumberingStyleName=::]
  [Replace][list][*]&[/list]
  [Command] ReplaceAll

  ; Remove redundant list tags 
  [Find]\[/list]\p\[list]
  [Replace]\p
  [Command] ReplaceAll

 
  
[Name] Text [Sel.]	Verbinde nicht durch leere Absätze getrennte Absätze
 ; block of empty paragraphs replace by one empty par 
  [Find]\p{2,}
  [Replace]\p\p
  [Parameters] MsgOff Regular CurrSelection 
  [Command] ReplaceAll

 ; remove spaces and tabs on the starting and enddin of paragraphs
  [Find](^( *\t*)*|( *\t*)*$)
  [Replace]
  [Command] ReplaceAll

 ; remove ends of paragraphs   
  [Find]\p
  [Replace]  
  [Command] ReplaceAll

 ; remove space at the beginning paragraph behind of block empty paragraphs 
  [Find]^ 
  [Replace]
  [Command] ReplaceAll


[Name] Text [Sel.]    Leere von nicht leeren Absätzen trennen
  [Find]^.+$
  [Replace]&\p
  [Parameters]  MsgOff Regular CurrSelection
  [Command] ReplaceAll


; separator
[Name] 9pt zu 11pt ändern
  [Find][:::CharHeight=9::]
  [Replace]\A{CharHeight=11}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Arial zu Times ändern
  [Find][:::CharFontName=Arial::]
  [Replace]\A{CharFontName=Times}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] linker Rand 1cm zu Textkörper setzen
  [Find][:::ParaLeftMargin=1000::]
  [Replace]\P{Textkörper}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] hardSpace to FNZ
  [Find] 
  [Replace]\p
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Absatzabstand
  [Find][:::ParaBottomMargin=212::]
  [Replace]\A{ParaBottomMargin=100}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Alle Zahlen hochstellen
  [Find]([0-9]+)
  [Replace]\A{CharEscapement=101}\A{CharEscapementHeight=58}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Seitenzahlen im Text anpassen
  [Find](\(S\.[0-9f\-]+\))
  [Replace]\C{Seitenzahl}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] feste Seite durch Absatzlinie ersetzen
  [Find]\m
  [Replace]\A{TopBorder: Color=0 InnerLineWidth=0 OuterLineWidth=7 LineDistance=0 LineStyle=0 LineWidth=7}\r\p
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
[Name]

[Name] Hyperlinks nur in Auswahl entfernen
  [Find][:::HyperLinkURL::]
  [Replace]\h
  [Parameters]   MsgOff  Regular  CurrSelection  
  [Command] ReplaceAll

[Name] Hyperlinks entfernen ganzer Text
  [Find][:::HyperLinkURL::]
  [Replace]\h
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] /*worte zu kursiv fett*/
  [Find]/([A-Za-z ]+)/
  [Replace]\A{CharPosture=1}\1
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]\*([A-Za-z ]+)\*
  [Replace]\A{CharWeight=150}\1
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] _worte zu kursiv_
  [Find]_([A-Za-z ]+)_
  [Replace]\A{CharPosture=1}\1
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] HFA Zusätze weg
  [Find]\*
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]\[[A-Za-z]\]
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] HFA Lieder
  [Find] / 
  [Replace]\n
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]([a-zäöüß])-([a-zäöüß])
  [Replace]\1\2
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Online Bibel to tsc
  [Find] \(.*CH\)
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]¶
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]^$
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]\p
  [Replace]\n
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]  
  [Replace] 
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find] ([0-9]+)
  [Replace]\n\1
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]”
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]“
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] CCFMC Zahlen weg
  [Find]*\([0-9]+\)
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]([a-z"])[0-9]+
  [Replace]\1
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
 
[Name] Gutenberg CHAPTERs
  [Find]^CHAPTER ([IVXL]+\.).*\p\p
  [Replace]\1 
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]--
  [Replace]–
  [Parameters]   MsgOff  
  [Command] ReplaceAll
  [Find]^$
  [Replace]
  [Parameters]   MsgOff  
  [Command] ReplaceAll


[Name] AnfZeichen u GedStrich 
  [Find]"(\l)
  [Replace]„\1
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]([,\.:!?])"
  [Replace]\1”
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find](\l)"
  [Replace]\1”
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find] - 
  [Replace] – 
  [Parameters]   MsgOff  
  [Command] ReplaceAll

[Name] Infohandler Exporte
  [Find][:::CharHeight=14::]
  [Replace]\P{Überschrift 1}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find][:::CharColor=0|CharFontName=Arial|CharHeight=10::]
  [Replace]\P{Textkörper}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]Infotext:\p
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]Zeitdaten:\t
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]Datum: (.*[.^$]*)
  [Replace]\D\P{Zitat}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find] - Zeitdauer: (.*[.^$]*)
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]^$\p*
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] 14pt zu Header1
  [Find][:::CharHeight=14|CharWeight=150::]
  [Replace]\P{Überschrift 1}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll


[Name] Deutschlandradio
  [Find]Deutschlandradio .*\p
  [Replace]\P{Überschrift 1}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]---------------\p.*
  [Replace]\P{Überschrift 2}
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]---------------\p
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll
  [Find]^$\p*
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll


[Name] Zeilenschaltung durch Absatzschaltung
  [Find]\p
  [Replace]\n
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Absatz- durch Zeilenschaltung
  [Find]\n
  [Replace]\p
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] scan Silbentrennung weg
  [Find]-\p
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

; separator
[Name]
[Name] Text [Alles]	Konvertiere Datum von  yyyy-mm-dd  zu  dd.mm.yy
  [Find](\d{2,2})(\d{2,2})-(\d{1,2})-(\d{1,2})
  [Replace]\4.\3.\2
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll


[Name] Text [Alles]	Konvertiere Datum von  dd.mm.yyyy  zu  yy-mm-dd
  [Find](\d{1,2})\. *(\d{1,2})\. *(\d{2,2})(\d{2,2})
  [Replace]\4-\2-\1
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll


[Name] Text [Alles]	Konvertiere Datum von  dd.mm.yyyy  zu  yy_mm_dd
  [Find](\d{1,2})\. *(\d{1,2})\. *(\d{2,2})(\d{2,2})
  [Replace]\4_\2_\1
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll


[Name] Text [Alles]	Alle Hyperlinks in neue Datei schreiben
  [Find][:::HyperLinkURL::]
  [Replace]Link \i, on page \I: \D\C{Example}\h&\h{\u}\C (URL: \C{Example}\u\C)\C{Example}\p\h\R
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Text [Alles]	Alle Notizen in neue Datei schreiben
  [Find][::Note::]
  [Replace]Note &\i, on page \I,  Content:\D\C{Example}\C\n\o\p\p\R
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Text [Alles]    Alle Bilder in neue Datei schreiben
  [Find][::Picture::]
  [Replace]Picture \i, on page \I, Name of picture: \C\O\C{Example}&\p\p\C\R
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Text [Alles]    Alle Tabellen in neue Datei schreiben
  [Find][::TextTable::]
  [Replace]Table \i, on page \I, Name of table: \C\O\C{Example}\p&\p\p\C\R
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Text [Alles]    Alle Tabellen aufheben
  [Find][::TextTable::]
  [Replace]
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll

[Name] Text [Alles]    Alle Textrahmen in neue Datei schreiben
  [Find][::TextFrame::]
  [Replace]Frame \i, on page \I, Name of Text Frame: \C\O\C{Example}\p&\p\p\C\R
  [Parameters]   MsgOff  Regular  
  [Command] ReplaceAll



[End]  
  
