This script encloses selection in the specified tags.
Function EncloseInTags(tag1, tag2)
if Text.TestTextSelection then
dim objStart = Text.GetCursor(modeSrcOn,cposSelBegin,False)
dim objEnd = Text.GetCursor(modeSrcOn,cposSelEnd,False)
Ted.CursorTo objend
ted.inscmd tag2
Ted.CursorTo objStart
ted.inscmd tag1
end if
end function
Example:
EncloseInTags "bd 1", "bd 0"