Action to search and replace in Author mode

Post here questions and problems related to oXygen frameworks/document types.
mboudreau
Posts: 68
Joined: Sat Jan 07, 2017 1:23 am

Action to search and replace in Author mode

Post by mboudreau »

Is it possible to create Actions that find and replace text throughout an entire document in Author mode? For example, changing multiple spaces to a single space. I know this is easy to do using the Find dialog, but I'd like to be able to assign frequently used replace-all operations to a toolbar button.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Action to search and replace in Author mode

Post by Radu »

Hi,

Again, maybe you can do this with a custom JSOperation calling Javascript code which performs various changes on the opened document:

https://github.com/oxygenxml/javascript ... operations

Or you can create a custom Java operation which uses the API for the same purpose.

We have Java API to create a text iterator over the entire content:

ro.sync.ecss.extensions.api.AuthorDocumentController.getTextContentIterator(int, int)

https://www.oxygenxml.com/InstData/Edit ... r-int-int-

Sample usage:

https://github.com/sbsdev/dtbook-author ... ation.java

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply