>>318-319
どういうテキストを扱うのか分からんのだが
文字色だけで区別したいならbyteじゃなくて
style run単位で比較すれば少しは速くなるかと
>319のbyteをstyle runに置換するだけでもいいと思うけど
違うパターンで作ってみた
一応検証済み、環境は 微妙に違うけど大丈夫でしょう
OS 9.1、AppleScript 1.5.5、Jedit 4.0.5

tell application "Jedit4"
activate
set theName to name of document 1
set newText to make new document
tell document theName
repeat with idx from 1 to (count of style run)
if fore color of style run idx is not {0, 0, 0} then
insert style run idx at after last byte of newText
end if
end repeat
end tell
end tell

>>320
不要なウィンドウって何?試したけど出なかった