I should have started a new thread....
----------------------------------------------------------------------------
tell application "Script Debugger"
tell document 1
set {x1, null} to character range of selection
tell (get source text)
if x1 = 1 then -- Before first character:
set SRC to "ˆ" & it
else if x1 > (get its length) then -- After last character:
set SRC to it & "ˆ"
else -- Normal:
set SRC to text 1 thru (x1 - 1) & "ˆ" & text x1 thru -1
end if
end tell
set fRec to find text "^(.*?)(?:ˆ)(.*?)$" in SRC using "\\1\\2" with regexp set selection to {((matchPos of fRec) + 1), (matchLen of fRec)}
end tell
end tell
----------------------------------------------------------------------------