Hi,
Marking English paragraphs with BLUE color (for German paragraphs use German alphabet):
set englishAlphabet to {" ", "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~", ""}
tell application "Pages" to tell document 1
repeat with textItem in (get text items)
tell textItem
set theParagraphs to paragraphs of object text
repeat with i from 1 to count theParagraphs
set theParagraph to item i of theParagraphs
set isEnglish to true
repeat with char in (get characters of theParagraph)
if not (contents of char is in englishAlphabet) then
set isEnglish to false
exit repeat
end if
end repeat
-- MARK English text with BLUE color:
if isEnglish then set color of paragraph i of object text to {0, 0, 65535}
end repeat
end tell
end repeat
end tell
Do delete paragraph directly, use this instead of color setting:
if isEnglish then delete paragraph i of object text