tell application "BBEdit"
try
tell text of front text window
set lineOfInsertionPoint to line (startLine of selection)
set findReco to find "^\\d+\\." searching in lineOfInsertionPoint options {search mode:grep}
if found of findReco = true then
set leadingNumber to text 1 thru -2 of (found text of findReco)
set text of selection to return & (leadingNumber + 1) & ". "
select insertion point after selection
else if found of findReco = false then
set findReco to find "^\\* " searching in lineOfInsertionPoint options {search mode:grep}
if found of findReco = true then
set text of selection to return & "* "
select insertion point after selection
end if
end if
end tell
on error errMsg number errNum
set sep to "=============================="
set e to sep & return & "Error: " & errMsg & return & sep & return ¬
& "Error Number: " & errNum & return & sep
beep
display dialog e
end try
end tell