@Eugene Tyson , @Nick Passmore , @Laubender , @tobias.wantzen
Thank you guys!
Even if none of these script is perfect, they put me in the right direction:
tell application id "InDn"
set theConditions to name of conditions of active document
set condToClear to condition "relectureWord" of active document
repeat with aCondition in theConditions
if (every text style range of selection whose name of applied conditions contains aCondition) ≠ {} then
set theFound to object reference of (every text style range of selection whose name of applied conditions contains aCondition)
repeat with aFound in theFound
set condApplied to applied conditions of aFound
set condToKeep to {}
repeat with aCond in condApplied
if contents of aCond ≠ condToClear then set end of condToKeep to contents of aCond
end repeat
apply conditions aFound using condToKeep with remove existing
end repeat
end if
end repeat
end tell
This snippet is part of a script that loops through selected paragraphs. Be careful if you use it "as is": the text style ranges will not necessarily stop at the end of the selection...