Hey Folks,
Here's another method:
tell application "BBEdit"
tell text of front document
select insertion point after it
end tell
end tell
I nearly always prefer to use tell-blocks to reference objects rather than one-liners, because frequently when I forget to do so I end up having to refactor my code when I add or change something.
For this use-case I might do something like this:
tell application "BBEdit"
tell front document
tell its text to select insertion point after it
end tell
end tell
But if I will take time to write the code “correctly”:
tell application "BBEdit"
tell front document
tell its text
select insertion point after it
end tell
end tell
end tell
Then I have no problem coming back in later and doing more with either the document, or the text, or both.
Probably 8 times out of 10 I'll regret not using the above construct, because a short time later I'll be modifying it to something on the order of this:
tell application "BBEdit"
tell front document
tell its text
set after it to linefeed & "Some more text..."
select insertion point after it
end tell
end tell
end tell