Select range of lines and copy to clipboard

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

Select range of lines and copy to clipboard

Post by jgodfrey »

I've written a script that can detect a range of lines I'm interested in. Now, I'd like to:

1. Select the range of lines
2. Copy them to the clipboard

The only way I've found to select a range of lines is by using the Document.Cursor*(True) methods. While that works, it seems like it should be possible without physically navigating around the document. I tried using SelectLine() in a loop, but it only selects 1 line at a time. A SelectLineRange(Begin, End) method would be nice. Are the Cursor methods the only way to do this right now? On a large range, selection via Cursor* is quite slow...

For item #2 above, I haven't found a way to copy the selection to the clipboard via script. Currently, after my script runs, I need to press Ctrl+C. Is it possible to copy the selection to the clipboard?

Thanks,

Jeff
Post Reply