Feature request - add the ability to search inside .tmdx files to the file manager

Post here those questions, bug reports and suggestions for SoftMaker Office 2018 for Linux that do not fit in any of the application-specific subforums.
Post Reply
colonel_panic
Posts: 52
Joined: Fri Jun 08, 2018 9:19 pm

Feature request - add the ability to search inside .tmdx files to the file manager

Post by colonel_panic » Fri Oct 18, 2019 2:13 pm

Hi

We are leaving Windows 7 completely at work when it reaches its end of life next year. Our plan is to use Debian, which we've been using alongside MS for several years now.
If we want to search for text inside Textmaker files, we have to use zgrep which I worked out in this post. This is OK, but some of our staff will find the terminal a little intimidating. It would be really nice if the Search dialog in the File manager had the ability to search for text inside textmaker files, and I am sure it wouldn't be a difficult thing to add.

User avatar
Michael Uplawski
Posts: 184
Joined: Thu Dec 11, 2014 11:43 pm
Location: Canton Magny (previously Canton Carrouges), Orne, Normandy (previously Lower Normandy)

Re: Feature request - add the ability to search inside .tmdx files to the file manager

Post by Michael Uplawski » Sat Oct 19, 2019 7:34 am

The file manager itself must be prepared for that. PCManFM, Thunar and probably others allow to add user-defined commands which will be available from the context-menu (right-click-menu) after a file of a certain type (mostly based on the filename-extension) or a directory are selected.

Here is a screen shot of the dialog (in French locale) serving to add commands to PCManFM, Thunar looks similar:
sc_pcmanfm.png
If SoftMaker can assist, they will be able to do so for only one file manager at a time. But there are so many.
Hindsight is in the eye of the beholder.

User avatar
Michael Uplawski
Posts: 184
Joined: Thu Dec 11, 2014 11:43 pm
Location: Canton Magny (previously Canton Carrouges), Orne, Normandy (previously Lower Normandy)

Re: Feature request - add the ability to search inside .tmdx files to the file manager

Post by Michael Uplawski » Sat Oct 19, 2019 8:43 am

Edits 21/10/2019: Call grep with -n -T for line-numbers.

And here is a script which works even where the installed version of grep is too new and does no longer support the '-r' option. It uses html-tidy to beautify the xml-code and searches for text inside paragraph-tags (w:t). This is more an example and should be easily adaptable to use different helper applications, like xmllint and the like.

Use yad, dialog or wiptail to create graphical - or semi-graphical interfaces which can be used from file-managers:

Code: Select all

#!/bin/bash

td=`mktemp -d`
cp "$2" "$td"
OD=`pwd`

cd "$td"
file=`basename "$2"`
unzip "$file" 1>/dev/null
tidy -i -m -xml word/document.xml 2>/dev/null

grep -n -T "$1" word/document.xml

cd "$OD"
rm -rf "$td"
Hindsight is in the eye of the beholder.

Post Reply

Return to “SoftMaker Office 2018 for Linux (General)”