View Issue Details

IDProjectCategoryView StatusLast Update
0017168ScribusScripterpublic2024-03-03 07:12
Reporterale Assigned Tocbradney  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version1.7.0.svn 
Fixed in Version1.6.2.svn 
Summary0017168: Scripter: get the current text selection
Descriptionwith the scripter it seems to only be possible to set the current text selection, but not retrieve it.
(i mean: the indexes with the start and end of the selection, not the content of the selection!)
TagsNo tags attached.
PatchNo

Activities

cbradney

2024-02-27 21:35

administrator   ~0051011

So the reverse of selectText()? ie.. you want to get start and end (or start and count?) of the selection itself?

ale

2024-02-28 12:12

manager   ~0051013

exactly!

i'm working on a script for sorting alphabetically the paragraphs in a given selection and i think that i need to know where the selection starts and ends.

i have now created a python function that approximates it and if it indeed i need this function i will try to ,create a patch.

if anybody has a good candidate for the name, suggestions are welcome.

cbradney

2024-02-28 21:21

administrator   ~0051015

Last edited: 2024-02-28 21:23

Try what I have committed in r26037. Its not quite right yet... as in we might want to refine how the indexes are returned, or +/-1 on them.. but we have the basics

getSelectedTextIndexes("TextFrameName")

ale

2024-02-29 07:26

manager   ~0051016

nice, thanks!

i have not compiled it yet, but had a look at the commit.

i have three suggestions:

- since selectFrameText() and selectText() are using start and length, i would return the same values here (instead of start and end)
- what about naming it getSelectedTextRange() ?
- this function is the also the companion of getAllText() and getFrameText(): i guess that we also need getSelectedFrameTextRange() returning the part of the selection in the current frame, with 0 being the start of the current frame.

cbradney

2024-02-29 20:29

administrator   ~0051020

ok, r26038 has getSelectedTextRange that returns start and length now.

cbradney

2024-02-29 20:51

administrator   ~0051021

r26039 has getFrameSelectedTextRange.

ale

2024-03-02 06:59

manager   ~0051022

thanks, it looks good!

cbradney

2024-03-02 21:04

administrator   ~0051023

Backported to 1.6.2.svn, closing bug

Issue History

Date Modified Username Field Change
2024-02-26 20:33 ale New Issue
2024-02-26 20:56 ale Description Updated
2024-02-27 21:35 cbradney Note Added: 0051011
2024-02-28 12:12 ale Note Added: 0051013
2024-02-28 21:21 cbradney Note Added: 0051015
2024-02-28 21:23 cbradney Note Edited: 0051015
2024-02-29 07:26 ale Note Added: 0051016
2024-02-29 20:29 cbradney Note Added: 0051020
2024-02-29 20:51 cbradney Note Added: 0051021
2024-03-02 06:59 ale Note Added: 0051022
2024-03-02 21:04 cbradney Assigned To => cbradney
2024-03-02 21:04 cbradney Status new => resolved
2024-03-02 21:04 cbradney Resolution open => fixed
2024-03-02 21:04 cbradney Fixed in Version => 1.6.2.svn
2024-03-02 21:04 cbradney Note Added: 0051023
2024-03-03 07:12 ale Status resolved => closed