I am trying to translate a few Applescript (AS) into Javascript (JXA) for BBedit.
It's been a fun little thing to knock some rust off, but I'm stumped. With AS I can set an insertion point into a BBEdit document thusly;
tell application "BBEdit"
activate
tell text 1 of window 1
select insertion point before line 40
end tell
end tell
I'm totally stumped when it comes to JXA. I've been poking around in the line objects but I can't find a insertsionPoint property.
You can access selection properties like so;
currentLine = bbedit.selection().startline().
But it is read only. So I think you need access to that select method if you want to set a selection or insertion point. I have no clue how, or if you can with JXA.
Anyone know how to set a BBEdit insertion point and/or selection with JXA? Thanks.