Jump to content

Counting words


aveltmp

Recommended Posts

I need to count the number of words the end user selects on a given text. The end users can highlight and unhighlight words by clicking on two buttons after selecting the words, so I need to add and subtract to the counter. I have been able to count the number of words selected when the button is clicked, but I need to add/subtract multiple times, otherwise the counter always restart everytime the user click one of the two buttons.

This is the code I have right now:

on mouseUp
put the number of words of field "Text2" into tText
if the selectedText is not empty then
put number of words of selectedText into tSelected
put tText - tSelected into tNumberSelected
else
answer "Por favor, seleccciona las palabras que quieres subrayar."
pass mouseUp
end if

Any suggestion?

Link to comment
Share on other sites

Hi @aveltmp,

I know I am not personally familiar with the third party program you are referring to. So I am not familiar with the formula in your first post, and I am also a little unclear what the goal is.

With that as a preface, if I understand your goal, you can count words natively in Accordance. If you select a passage and click the "Analysis" it will tell you how many words there are in your selection.

 

If you are trying to change the number, what is coming to my mind is for people to highlight specific words you want to eliminate, then use the CONTENTS function to eliminate the highlight style. This eliminates verses with the highlighted words in them, but sounds similar to what you are describing.

I hope this helps some.

Kristin

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...