cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Request for Arbortext API for selecting parts of text from different elements

Request for Arbortext API for selecting parts of text from different elements

This is a request from a PTC partner.

 

They need to programatically select a section of text that might extend over multiple XML elements.  If they use CharRightExtend, it will always require the text to be in a balanced selection.  This is true even f they set the option balancedselections=off.

 

The find() api has an option to ignore balanced selections, but find() will not work in their script the way CharRightExtend does.

2 Comments
GarethOakes
16-Pearl

Yes, good idea. We have had some issues with clients who are using Arbortext almost like a word processor and need character-by-character change tracking across elements. In those cases our custom code also needs to be able to work on a character-by-character basis irrespective of the XML element structures.

plutsky
13-Aquamarine
Status changed to: Current Functionality

It turns out that this can be done today.  If you look at the code for the alias CharRightExtend in commands.acl:

alias CharRightExtend {
if (columnview_cell_focus() > 0) {
beep;
} else {
unit_caret_move($h::tblRight);
}
}

You can turn this into a function and turn off the balancedselections setting inside the function like this:

 

function CharRightExtend2() {
local balspecorig=option("balancedselections")
set balancedselections=off
if (columnview_cell_focus() > 0) {
beep;
} else {
unit_caret_move($h::tblRight);
}
set balancedselections=$balspecorig;
}