答案1
我不知道其他应用程序,但你可以在 TextEdit 中使用这样的脚本:
tell application "System Events" to tell process "TextEdit"
set {x, y} to value of attribute "AXSelectedTextRange" of text area 1 of scroll area 1 of window 1
end tell
tell application "TextEdit"
set color of characters x thru y of document 1 to {65535, 0, 0}
end tell