Scripted selections and current selection mode

Ask questions about how to create a script or swap scripts with other users.
Post Reply
jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Scripted selections and current selection mode

Post 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
User avatar
Rickard Johansson
Site Admin
Posts: 6577
Joined: 19 Jul 2006 14:29

Re: Scripted selections and current selection mode

Post 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)
jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: Scripted selections and current selection mode

Post by jgodfrey »

Thanks Rickard!
tufail123
Posts: 1
Joined: 30 Oct 2014 11:58

Re: Scripted selections and current selection mode

Post 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.
Decrease your exam mcp training courses by using our latest SAP and best quality University of California, Los Angeles and passguide.
Post Reply