Formulas

Discussion related to "Everything" 1.5.
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Formulas

Post by void »

Everything 1.5.0.1400a adds the following functions:

PINYIN - convert text to pinyin, can be used for sorting by pinyin:
a:=PINYIN($name:) sort:a

GETINDEXEDPROPERTY - same as GETPROPERTY, but only indexed properties.
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Formulas

Post by void »

Everything 1.5.0.1405a fixes an issue with TRUNC not truncating towards zero.

Everything 1.5.0.1405a fixes an issue with QUOTIENT(x,y) converting parameters to an integer instead of the result.

Everything 1.5.0.1405a adds EXISTS_ON_DISK() FILE_EXISTS_ON_DISK() FOLDER_EXISTS_ON_DISK().
cosmito
Posts: 17
Joined: Fri Mar 21, 2025 3:20 am

Re: Formulas

Post by cosmito »

So this is either very badly explained or I am extremely stupid or a bit of both.

This does not work:

Code: Select all

a:=$width:*$height: add-column:a
This does not work:

Code: Select all

a:=$width:*$height add-column:a
This does not work:

Code: Select all

a:=$width*$height add-column:a
All I want from life is a column that calculates MEGAPIXELS for image files (yeah I'll add division but the basics fail) based on their already indexed properties

Code: Select all

width
and

Code: Select all

height
which I can already find and add as columns if I want.

I don't know what kind of logic I must apply because the painfully simple, intuitive and obvious stuff fails.
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Formulas

Post by void »

Your first search is correct:

a:=$width:*$height: add-column:a


Please make sure the file has a width and height.
Otherwise, nothing is shown.

What is shown for you?
cosmito
Posts: 17
Joined: Fri Mar 21, 2025 3:20 am

Re: Formulas

Post by cosmito »

Column A appears with nothing populated. This is the whole search bar:

Code: Select all

\part\of\path\ *.jpg a:=$width:*$height: add-column:a
cosmito
Posts: 17
Joined: Fri Mar 21, 2025 3:20 am

Re: Formulas

Post by cosmito »

So I only tested with "width" but added also the "height" column and that one is empty so this is why the whole thing fails.
So for images I only have these properties with valid values: "dimensions" and "width"
"Dimensions" is: 123x456
Can I parse this instead?
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Formulas

Post by void »

Please try:

Code: Select all

*.jpg a:=ELEMENT($dimensions:,"x",1)*ELEMENT($dimensions:,"x",2) add-column:a
Would you like to index height too?
If you are already indexing height, please check your height filters.
cosmito
Posts: 17
Joined: Fri Mar 21, 2025 3:20 am

Re: Formulas

Post by cosmito »

Thank you, the formula worked, just added the division to give megapixels and a label for column:

Code: Select all

a:=ELEMENT($dimensions:,"x",1)*ELEMENT($dimensions:,"x",2)/1000000 add-column:a a-label:="MP"
Can I save this column somehow to re-add it later to any search I need? I know I can bookmark the whole search.
What would be the simplest method of formatting the numerical result to just 2 decimals?

Regarding the height, I dug into Options -> Indexes -> Properties:
- width is not indexed
- height (the one with no values) is indexed but only for video files, with image files excluded

So this is odd. Because width is not indexed but it is read from file metadata. At the same time, height has indexing excluded for images but this should not prevent Everything to read it from files metadata, right?
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Formulas

Post by void »

Can I save this column somehow to re-add it later to any search I need? I know I can bookmark the whole search.
Add it as a bookmark.
Give the bookmark a macro, eg:
mp

Then all you need to do in the future is include
mp:
in your search.


What would be the simplest method of formatting the numerical result to just 2 decimals?
a:=TEXT(ELEMENT($dimensions:,"x",1)*ELEMENT($dimensions:,"x",2)/1000000,"0.00") add-column:a a-label:="MP"



Regarding the height, I dug into Options -> Indexes -> Properties:
- width is not indexed
- height (the one with no values) is indexed but only for video files, with image files excluded
Easiest way is to add images to your index height property.
For example, change Include only files to include:
jpg;png;gif;webp


If you index properties, only the included files will show that property. (ie: your video files)
Everything 1.5 doesn't show mixed indexed and unindexed information.
It's either one or the other.
cosmito
Posts: 17
Joined: Fri Mar 21, 2025 3:20 am

Re: Formulas

Post by cosmito »

a:=TEXT(ELEMENT($dimensions:,"x",1)*ELEMENT($dimensions:,"x",2)/1000000,"0.00") add-column:a a-label:="MP"
I actually did it like this:

Code: Select all

a:=ELEMENT($dimensions:,"x",1)*ELEMENT($dimensions:,"x",2)/1000000 add-column:a a-format:0.00 a-label:="MP"
Can I filter "a" or "mp" higher/lower than value without using "eval"?
Everything 1.5 doesn't show mixed indexed and unindexed information.
It's either one or the other.
This is what I tried to tell you: the property that showed the values, "width" is not indexed, at least I don't have it added in Options -> Indexes -> Properties. Unless this property is indexed by default, the "width" property is read from the search result files.

But the "height" property, the one that does not show any value in the column, is manually indexed. Yes, there is an exclusion for image files but then how come "width" (which is not indexed) has values in the corresponding column? Neither of them should show any values for the image files per current settings (one is not indexed, the other has exclusions).
void
Developer
Posts: 19863
Joined: Fri Oct 16, 2009 11:31 pm

Re: Formulas

Post by void »

Can I filter "a" or "mp" higher/lower than value with "eval"?
Yes, but
a
is normally treated as a string, so you'll need to convert to a number first:

VALUE($a:)>12


how come "width" (which is not indexed) has values in the corresponding column?
If the property is not indexed, it is gathered from disk.
If the property is indexed, but excluded, it is not gathered from disk.
-Gathering the property from disk would defeat the purpose of property indexing.
This might change in a future version..
cosmito
Posts: 17
Joined: Fri Mar 21, 2025 3:20 am

Re: Formulas

Post by cosmito »

Thank you very much for your help and clarifications.
Post Reply