I am trying to set up a macro to substitute the Latin alphabet equivalent to the Greek letters in a text. I am not sure but I think that is something on the order of at least 50 pairs of changes.
Below s the code generated when recording the find and replace for the first pair (Pi and Cap P). I edited the code some (cut out some lines), it is all of 1060 characters, of which 2 {0.19%) are of import to me). I need to change the two characters (ά → a) for the next iteration, later rinse repeat. Due to accent marks, vowels have at least two forms (e.g., ά, α, ἁ will all map to a), so there will be many “special cases” which if I was doing this manually would be merely tedious.
What I want to know is if there is a “simple” way to feed a paired list “Grk, Latin” to a loop which will replace content of VarA with contents of VarB, until the list runs out. Or count >N for what ever value of N tbd.
Could this be done with a table?
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:GoToStartOfDoc", "", 0, Array())
rem ----------------------------------------------------------------------
dim args2(21) as new com.sun.star.beans.PropertyValue
args2(0).Name = "SearchItem.StyleFamily"
args2(0).Value = 2
args2(9).Name = "SearchItem.AlgorithmType"
args2(9).Value = 0
args2(10).Name = "SearchItem.SearchFlags"
args2(10).Value = 65536
args2(11).Name = "SearchItem.SearchString" <<=====
args2(11).Value = "Π" <<=====
args2(12).Name = "SearchItem.ReplaceString" <<=====
args2(12).Value = "P" <<=====
args2(13).Name = "SearchItem.Locale"
args2(13).Value = 255
args2(14).Name = "SearchItem.ChangedChars"
args2(14).Value = 2
args2(15).Name = "SearchItem.DeletedChars"
args2(15).Value = 2
args2(16).Name = "SearchItem.InsertedChars"
args2(16).Value = 2
args2(17).Name = "SearchItem.TransliterateFlags"
args2(17).Value = 1073742848
args2(18).Name = "SearchItem.Command"
args2(18).Value = 3
args2(19).Name = "SearchItem.SearchFormatted"
args2(19).Value = false
args2(20).Name = "SearchItem.AlgorithmType2"
args2(20).Value = 1
args2(21).Name = "Quiet"
args2(21).Value = true
dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args2())