Я конвертирую текст HTML в обычный текст, и мне нужно заменить коды символов HTML фактическими символами, которые представляет код.
Следующий пример кода делает это для двух кодов символов, но требуется отдельная строка для каждого кода символа.
Есть ли способ заменить все это без жесткого кодирования каждого кода символа?
set theText to replaceText("&", "&", theText)
set theText to replaceText(" ", " ", theText)
on replaceText(find, replace, textString)
set prevTIDs to AppleScript's text item delimiters
set AppleScript's text item delimiters to find
set textString to text items of textString
set AppleScript's text item delimiters to replace
set textString to "" & textString
set AppleScript's text item delimiters to prevTIDs
return textString
end replaceText
Подробнее здесь: https://stackoverflow.com/questions/793 ... characters