Welcome Guest

Pages: 1
Find function and capitalization
mdy8893PostFebruary 14, 2020, 04:10
Newbie
Posts: 21
Registered:
July 26, 2019, 11:26
Normal topicFind function and capitalization

Hi there,

Is there any way to use the find function to find capitalized/uncapitalized words? For example, can I find every instance of 'the' which is uncapitalized? At the moment the find function seems to return all instances...

Many thanks

2MR2PostFebruary 14, 2020, 07:12
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: Find function and capitalization

By Find do you mean the main window filter editor? That's what is opened on a Command-F sequence.

If so, the answer is unfortunately no. The filters are compiled and as I'm using Apple's predicate filter there is no way to add options to an operator on the fly. Years ago the decision was made to go with case insensitive.

Yate's filter system is designed to be extensible via actions. Basically you set a variable to true or false and then have a filter which tests the variable.

For example the following action will look for case sensitive 'the' in the Title field and will select all files which match the filter.

Expand Execution to Unselected Files
Test if the Title field contains "the" (Set result and Variable 1)
Stop Action and Select Files Matching Filter "Variable 1 is True"

The filter would look like the attached image.

If you would like a generalized action to do the 'find' on an arbitrary number of fields and possible support 'word boundaries' let me know. You'd get prompted for the pattern and the options.
Image

mdy8893PostFebruary 20, 2020, 13:34
Newbie
Posts: 21
Registered:
July 26, 2019, 11:26
Normal topicRe: Find function and capitalization

Thanks as ever for the swift reply, 2MR2.

Sorry if I'm overlooking something simple, but I'm really confused with the second part of the action. How do you set the result to 'the'? What action function do you use for this?

Many thanks.

2MR2PostFebruary 20, 2020, 13:39
Avatar photo
Administrator
Posts: 2083
Registered:
August 23, 2012, 19:27
Normal topicRe: Find function and capitalization

Actually I wrote and published the action for the 5.1.1.x release. If you look on the resources page under Sample Actions you'll see an action named Generic Find Filter. It supports case insensitivity, word matching and any number of fields. Have a look at that. It should serve as a good example.

mdy8893PostFebruary 20, 2020, 14:22
Newbie
Posts: 21
Registered:
July 26, 2019, 11:26
Normal topicRe: Find function and capitalization

Wow. Works perfectly. Thanks a lot!

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.024 seconds.