Page 1 of 1

Scripted selections and current selection mode

Posted: 27 Aug 2011 17:27
by jgodfrey
I have a script that finds and selects specific text in a source file. However, the selection process only works as expected if TextEd is in "normal" select mode when the script is run. So, I'd like to do one of the following:
  • 1. Have the script determine the current selection mode, change it if needed, run as normal, and return to the previous selection mode. Currently however, I don't think it's possible to a) determine current selection mode, or b) change the selection mode.
  • 2. Employ a selection method that will work as expected regardless of the current selection mode.
Any suggestions?

Thanks,

Jeff

Re: Scripted selections and current selection mode

Posted: 27 Aug 2011 18:22
by Rickard Johansson
Added 3 new methods to the document object in v7.63:

IsColumnModeActive(): Boolean
SetColumnMode(const bActivate: Boolean)
SetSelection(const startx,starty,endx,endy: Integer)

Re: Scripted selections and current selection mode

Posted: 27 Aug 2011 18:57
by jgodfrey
Thanks Rickard!

Re: Scripted selections and current selection mode

Posted: 30 Oct 2014 12:10
by tufail123
I'm attempting to write a script that will select the entire method that contains insertion cursor. Looking at the scripting docs, GetMethodAtCursor(True) sounds like exactly what I need.