using terms from application "Xcode"
tell first text document
set {startLine, endLine} to selected paragraph range
if startLine > 1 then
set theText to (paragraphs startLine through endLine)
set theText to (theText as string)
make new paragraph at beginning of paragraph (startLine) with data theText
set selected paragraph range to {endLine + 1, endLine + endLine - startLine + 1}
else
beep 1
end if
end tell
end using terms from
重复排队:
using terms from application "Xcode"
tell first text document
set {startLine, endLine} to selected paragraph range
if endLine < (count paragraphs) then
set theText to (paragraphs startLine through endLine)
set theText to (theText as string)
(* delete (paragraphs startLine through endLine) *)
make new paragraph at beginning of paragraph (endLine + 1) with data theText
set selected paragraph range to {startLine, endLine}
else
beep 1
end if
end tell
end using terms from