Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Find function and capitalization
mdy8893
Newbie
Posts: 16
Permalink
Post Find function and capitalization
on: February 14, 2020, 04:10
Quote

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

2MR2
Administrator
Posts: 1352
Permalink
Post Re: Find function and capitalization
on: February 14, 2020, 07:12
Quote

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

mdy8893
Newbie
Posts: 16
Permalink
Post Re: Find function and capitalization
on: February 20, 2020, 13:34
Quote

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.

2MR2
Administrator
Posts: 1352
Permalink
Post Re: Find function and capitalization
on: February 20, 2020, 13:39
Quote

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.

mdy8893
Newbie
Posts: 16
Permalink
Post Re: Find function and capitalization
on: February 20, 2020, 14:22
Quote

Wow. Works perfectly. Thanks a lot!

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.101 seconds.