Formatting variables: somewhere must be a limit ;)

Started by sinus, September 10, 2014, 02:08:45 PM

Previous topic - Next topic

sinus

Hi,
Formatting variables is really a very good thing, very much is possible.

You can see in my attached image at the top right edge are 3 colored "icons", what all are created with variables and their formatting.
For me it is interesting, to have some informations in very short time, and for this, icons are welcome.
Of course for some entries like headline it makes mostly not sense to create an icon.

But for some values our brain takes an icon quicker like simply a "normal" text.
Like in my example I think, the green JPG shows for me very quickly, that this is a jpg-format. A NEF-format or Doc have other colors.
The extension I could have also put at the end of the (long) filename (after ... fischzucht_v1.jpg), also in different colors, but because my filenames have different lengths, the extension would be always in a different place, so the solution here is better for me.

The 19 stays for 19 keyword-entries.
The ATT says me, that this file has some Attributes-entries. If the file has no entries, no icon will appear.

Now to the interesting things of my questions:
The footer is obviously created by the Headline, the City (Rohr) and the caption.

Now on the left bottom border, in pink, is the dimension of the file, and in yellow, this is the updated date of the file.
The yellow date I have formatted with this:

{File.Updated|Format:DD-YYYY}

Now, sorry for the long text, I come to my question.
For me it would be interesting, whether a file is, say, over 2000 pixel high or not.

And it would be interesting, if a file would have been last updated, say, half a year ago.

My question: Is it possible, to create a formatting, something like
"if pixel is bigger then 2000 pixel high, then the value is true, else not" and also
"if date is older than 6 monthes, the value is true, else not".


I tried to read in the helpfile, but though there are MANY formatting things, I could not find something, but with my limited knowledge it is very good possible, that I missed a clever idea.

IF this would be possible, then you guessed it maybe: then I could (maybe) create two "icons" more:

If the file would be over 2000 pixel in height; an colored icon would appear (like the blue ATT), else not
and if the file would be longer not more updated (or modified), an icon would appear.

Specialy for the dimension this would be great, because I could see much quicker, if there a file is big or not:

3'600 x 2135
B

So I could also see very quickly all websized images and so on.

I think, it is not possible now and this is a limit of formatting, but to be honest, I had never thought, that I could create "icons" like in the upper right corner of my attached image, hence maybe it it also possible.

If not, maybe it makes sense, to create a feature request, but I do not know, if this would be very hard to implement.

Thanks for listening and for any tips or hints.

[attachment deleted by admin]
Best wishes from Switzerland! :-)
Markus

Mario

You cannot perform mathematical operations or date/time arithmetic in variables.
You can do that in a custom App or HTML template using JavaScript.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on September 10, 2014, 02:25:52 PM
You cannot perform mathematical operations or date/time arithmetic in variables.
You can do that in a custom App or HTML template using JavaScript.

Thanks, Mario, this gives me new possibilities.
So, you have mentioned it several time over the years: JavaScript is the stuff, what is good to lern.
Best wishes from Switzerland! :-)
Markus

Ger

Hi Marcus,
I like your questions... you're really trying to get the most out of IMatch!

I don't have a solid solution either, but a simple trick could be to simply use formatting on the first digit of the height (or width) of the image:
{File.MD.Exif::Main\40963\ExifImageHeight\0|substr:0,1}

If image sizes are between 1000 and 9999, you could use that digit for color coding. Not a perfect solution though...


sinus

Quote from: Ger on September 10, 2014, 09:04:27 PM
Hi Marcus,
I like your questions... you're really trying to get the most out of IMatch!

I don't have a solid solution either, but a simple trick could be to simply use formatting on the first digit of the height (or width) of the image:
{File.MD.Exif::Main\40963\ExifImageHeight\0|substr:0,1}

If image sizes are between 1000 and 9999, you could use that digit for color coding. Not a perfect solution though...

Hi Ger,
Thanks for your post.  :)
Thought not an such things, seems to be also very interesting. I will try this ... one day I will have a very good thumb-layout, at least for me ;)

Best wishes from Switzerland! :-)
Markus

sinus

Hi,
Thanks to Ger I could create new formatted variables, and like I have seen, ahem, formatting variables has not a lot of limits - maybe even Mario did not know!  8)  ;D

First we can add several "is" or "contains", each after each.
So this variable here

<Run FontSize='11pt' Foreground='#CCFF33' >{File.Width|contains:4',VERY BIG;contains:3',BIG;contains:2',medium;is:0,NULL}</Run>

gives the results, what I hoped to get. You can see this in my attached image. The greenish words are from this variables, just above the real pixels.

This means, I can "replace" a width over 4'000 pixel (for example) with a word like "VERY BIG" and another with over 2'000 pixel with "medium".

This means, I guess, I am also able to create a kind of "icon" (see in my first post above), if a file has 1'000 - 1'999 pixel or 2'000 - 2'999 and so on.
Note, I putted in the variable for a file over 2'000 pixel the "contains:2'", this made it.

Of course the variable is not finnished yet, I have still to work further, but I think, it will work.  :D

[attachment deleted by admin]
Best wishes from Switzerland! :-)
Markus

sinus

Just to finnish this.
As you can see in my attachement, my Layout is almost finnished.
Thanks for all your help!

You can see, upper left ist the (long) filename.
Upper right are the "icons" for the format (Nef is red, jpg blue, doc lila and so on).

G1,G2 ... means the size of the pixel-width, G1 means a number like 1300 pixel, G2 means 2xxx, G3 3xxx and so on.
I had wished to make this better, but for this we should be able to count inside variables, and this is not possible. But this system here is enough good for me, to see on one view, if the file is big or medium and so on.


ATT means, that this files has Attributes-entries.
And the green number means the number of keywords.

The colors of the "icons" does change, depending on the value.

In the footer is the headline, and in the second line the city and Caption. The caption is only one line, that is enough for me (more infos can be seen in the info of the file).

The last 3 entries are left:
orginal date
modified date
updated date
(I am not sure, if I leave this, but sometimes this is useful)

Bottom right is the size, exactly pixels and the folder.

I was not able to make the space between the last 3 lines smaller, no matter, what I entered (size and fontsize), this is a bit a pity, but not that bad. (the lines above to make smaller is not a problem, but here it was not possible.

This is only meant as a information, for people, who does play with the file windows layout.
Have fun.

[attachment deleted by admin]
Best wishes from Switzerland! :-)
Markus

jch2103

Nice work! Just curious: Does this affect thumbnail display speed in any significant way?

John
John

BanjoTom

I've made a start along these same lines, but don't use as much of the available headers/footers so far.  I'm curious too:  will this full use of the File Window layout slow anything down?
— Tom, in Lexington, Kentucky, USA

sinus

Thanks, John and Tom

I tested it only with 11'000 image, the speed is fine, super, no slowness or so.
Some variables slows down the scrolling, but not these here, I am astonished myself.

And it is really for me very helpful and very quickly to see for example the format (extension) with these kind of different colors.
Best wishes from Switzerland! :-)
Markus

Mario

IMatch calculates the contents of the file window panels when the panels become visible. This means than for a folder with 1000 files but a file window layout which only shows 50 files per page, the variables are calculated for these 50 files, not for all 1000 files. When you scroll, new files come into view, and the contents of these files are retrieved from the database and calculated. Once calculated, IMatch caches the results in memory until an event occurs which requires IMatch to reload the data (change in categories, collections, metadata etc.)

Variables are generally fast, I took great care for that because variables are used everywhere and are such an important feature. Another unique IMatch feature, of course  :D

Unless you use some really slow constructs like e.g., category variables which use a regular expression to filter out parts of the category hierarchy, which can easily lead to 5,000 or even 50,000 regular expressions to be evaluated. And if that has to be done for each of the 50 files in view in our example, it will slow down things quite badly.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on September 15, 2014, 09:56:56 AM
IMatch calculates the contents of the file window panels when the panels become visible. This means than for a folder with 1000 files but a file window layout which only shows 50 files per page, the variables are calculated for these 50 files, not for all 1000 files. When you scroll, new files come into view, and the contents of these files are retrieved from the database and calculated. Once calculated, IMatch caches the results in memory until an event occurs which requires IMatch to reload the data (change in categories, collections, metadata etc.)

Variables are generally fast, I took great care for that because variables are used everywhere and are such an important feature. Another unique IMatch feature, of course  :D

Thanks for these clarification, now I know, why scrolling is so fast, though I use a lot of variables.

Quote
Unless you use some really slow constructs like e.g., category variables which use a regular expression to filter out parts of the category hierarchy, which can easily lead to 5,000 or even 50,000 regular expressions to be evaluated. And if that has to be done for each of the 50 files in view in our example, it will slow down things quite badly.

Yes. And we can really do a lot with variables.
Like I do: a variable does count (VERY quickly), if it is a jpg, tif, doc, nef, xls, indd .... and displays every different format with another color.

Or another variable does display, if a file has 0 width (then it is a textfile) or has under 1'000 pixel (than it is for me a small image), or if it has over 1000, 2000, 3000 and so on ... and also the result will be displayed in different colors.

And if a file has attributes or not.

And how many keywords a file has.

And I must say, if I am scrolling fast, I can not see really a slow scrolling, all is very fast. Astonishing!

A big thankyou for implementing variables! Before the IMatch-time I did know nothing about variables, did not know even, what this is in a computer-envirement.  ::)
Best wishes from Switzerland! :-)
Markus

pajaro

I was inspired by Markus and started to play with various thumbnail layouts. So far I managed what I wanted (big thank to the forum, I would not be able to do it without the help here), but now I reached my limits. I am trying to put a short text in a color rectangle (much the same Markus did for his thumbnails) for files that contain "_PS" in their name. Well, color rectangles for files with different extensions work, but I can't figure out how to instruct IMatch to look at file names. I tried the following:

<Run FontWeight='Bold' Foreground='#000000' Background='{File.Name|is:_PS,#FFFFFF,#FFFFFF,false}'>{File.Name|is:_PS,PS, ,false}</Run>

but it is obviously wrong, because the name is not _PS, it just contains this string. I also tried File.Name|hasvalue:_PS, but it was also wrong. Searching the Help file did not help...

Thanks a lot.

sinus

Quote from: pajaro on September 15, 2014, 10:26:40 AM
I was inspired by Markus and started to play with various thumbnail layouts. So far I managed what I wanted (big thank to the forum, I would not be able to do it without the help here), but now I reached my limits. I am trying to put a short text in a color rectangle (much the same Markus did for his thumbnails) for files that contain "_PS" in their name. Well, color rectangles for files with different extensions work, but I can't figure out how to instruct IMatch to look at file names. I tried the following:

<Run FontWeight='Bold' Foreground='#000000' Background='{File.Name|is:_PS,#FFFFFF,#FFFFFF,false}'>{File.Name|is:_PS,PS, ,false}</Run>

but it is obviously wrong, because the name is not _PS, it just contains this string. I also tried File.Name|hasvalue:_PS, but it was also wrong. Searching the Help file did not help...

Thanks a lot.

Maybe instead of |is:_PS, you could try |contains:_PS
It it works not, please give the filename and what you want to display. sorry, I am in a hurry ...
Best wishes from Switzerland! :-)
Markus

pajaro

Quote from: sinus on September 15, 2014, 11:07:37 AM
Maybe instead of |is:_PS, you could try |contains:_PS

Thanks, tried it, but did not work.


Quote
It it works not, please give the filename and what you want to display. sorry, I am in a hurry ...

I also need to rush, I will do it later today. In any case, thanks a lot for your help.

sinus

Pajaro,

this should work:

<Run FontWeight='Bold' Foreground='#000000' Background='{File.Name|contains:_PS,#FFFF00,#FFFFFF}'>{File.Name|contains:_PS,PS,NO}</Run>

have fun and hopefully success!
Best wishes from Switzerland! :-)
Markus

pajaro

Quote from: sinus on September 15, 2014, 12:13:50 PM
Pajaro,

this should work:

<Run FontWeight='Bold' Foreground='#000000' Background='{File.Name|contains:_PS,#FFFF00,#FFFFFF}'>{File.Name|contains:_PS,PS,NO}</Run>

have fun and hopefully success!

Works beautifully, you are an expert  :). Thank you very much!!!

sinus

Quote from: pajaro on September 15, 2014, 01:11:59 PM
Quote from: sinus on September 15, 2014, 12:13:50 PM
Pajaro,

this should work:

<Run FontWeight='Bold' Foreground='#000000' Background='{File.Name|contains:_PS,#FFFF00,#FFFFFF}'>{File.Name|contains:_PS,PS,NO}</Run>

have fun and hopefully success!

Works beautifully, you are an expert  :). Thank you very much!!!

You are welcome! I hope, you can create a nice layout for you. A bit a lot of work, but at then we have a layout, what fits exactly our wishes!  :D
Best wishes from Switzerland! :-)
Markus

Richard

Quotea lot of work, but at then we have a layout, what fits exactly our wishes!
I wonder how many DAM applications there are that would allow a user to do what you have done.

jch2103

#19
Marcus, now I have to challenge you once again, this time to post your thumbnail layout so folks can take a close look at it. Perhaps somewhere in 'FAQ, Workflow, Tutorials, Tips & Tricks'? I think Mario must have anticipated this, because of the export/import feature for thumbnail layouts.

John
John

sinus

Yes, Richard, I wonder too. I guess, not a lot  ;D

John, I upload it first here. I have managed quite a nice layout for me.
Though, there are some (minor) design wishes, what are simply not possible or I make something wrong.

I attache the actual image with some remarks and I attache the layout for import, the only thing, you must first replace the ending (txt) with imfwl (the extension for laoyouts), then the file sinus-markus.imfwl is possible to import into the own layout.

So, here are some comments for, related to the uploaded image.
(Mario, if you are listening, I do not know, but for me it seems, that my point 1 COULD be a small glitch?! - or is it by design?)

1) If you look at the second last line of the footer, then you will see on the right side the pixels (1'972 x 2'000). If these pixels are not big, but instead small like in the third thumb with 480 x 200, then the line is not more on the right side (rechtsbündig), but it is moved to the left. It does not matter, if I choose left or center or right.

It has to said, that we have "only" 4 footers, here the 5. line is created by a <LineBreak/>, I guess or think, that this is reason?! Is there a way to have all lines neatly on the right side?
Here is the line:
<Run FontFamily='Courier New' FontSize='9pt'  FontWeight='normal'>{File.Width} x {File.Height}</Run><LineBreak/> <Run FontFamily='Courier New' FontSize='9pt'  FontWeight='Normal'>{File.Folder}</Run>

2)
The yellow "icon" with G1, G3 and 480 is created by the width of the image.
If it has 1000 and more, G1 will appear, 2000 and more G2, 3000 and more G3 and so on. This works, because I took "contains:2'. If I would take only a 2, than also other numbers like 5120 would be true. With 2' only all pixels from 2'000 to 2'999 will be true.
The same for 3' for 3'000 to 3'999 and so on.

But, unfortunately, I was not able to create a text like G0 for pixels under tousend, like 480 or 670 or so. This simply, because these numbers does not have a '.
Instead this the real number, like inthe third image, 480, will be displayed.
But in this case, this is not that bad.

Here is the line:
<Run FontFamily='Lucida Console' FontSize='9pt' Foreground='#000000' Background='{File.Width|is:0,#FF00FF,#FBD62A}'> {File.Width|contains:1',G1;contains:2',G2;contains:3',G3;contains:4',G4;contains:5',G5;is:0,00}</Run>

3) The green number, on the upper right corner of the thumb, shows the number of the keywords. Here we can see 1,2 and 3. This means, there are 1, 2 or 3 keywords. This works fine.
But sometimes (mostly) I will have keywords more then 10.
This means, the green "icon" will have numbers like

2
9
15
21

Now, if you look at the image, it would be nice, if I could do so, that the lenght of this numbers would be allways the same length, exactly the same lenght like the blue "icon" JPG. 

If you look at the second image, then all 4 "icons" in the upper right corner would have the same length, so that they would be better looking (I would then have to write instead G3 new GR3, so that all icons would have a length of 3 numbers or letters. That is why I take the font "Lucida Console, this is a font with the same length for all letters.

Here is the line:
<Run FontFamily='Lucida Console' FontSize='10pt' Foreground='#000000'  Background='{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|hasvalue:#00DE00;default:#FF00FF}'>{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|count:true} </Run>

4) A general remark: if we would have a formatting options with a kind of counting, creating layouts would be a lot easier and more would be possible.
This would be things like:

"if a number is bigger then xx, then display big, else small, but if the number is 2000 display correct"
"if a date is older than 2014-09-13, then display "old", else new"

and so on.
But I know, Mario has pointed this out, this is not possible, we can use Apps for this.

I write this only to say, this is not possible, but would be of course fine. Maybe other users must then not try a long time, when they can see, that a lot, really a lot, is possible, but not everything. ;)
Wishes from users, I think, are never ending. ;)

So, finally, the layout-possibilities are really impressive and for my wishes very good and fine
, if my skills does increase, maybe I will find somedays a solution for this and that.



[attachment deleted by admin]
Best wishes from Switzerland! :-)
Markus

ColinIM

Thank you for these 'tips' and for your insights Marcus. They're really inspiring, and - as is the case with all 'real life' examples - they've accelerated my understanding of what's tantalisingly possible in IMatch!

Colin P.

sinus

Thanks, Colin, for your kind words.
Yep, and over all (or at the bottom) I have to say, stays IMatch and this piece of software is really inspiring.  :D
Best wishes from Switzerland! :-)
Markus

sinus

To give an "update" of my current, formatted thumb in a file window, I attache a new screenshot.

I use more and more stackings. The top of a stack is for me the "master-thumb" of this stack.
This means, this master-thumb has some visually hints, mostly above the thumb, what shows me, what is the "status" of this stack.

This means, I can see for example, if the stack (the event) is delivered or if we have sent for this event an "addition" (invoice), or if there are important entries in the Attributes.

Instead that my eyes must go from Attributes to Metadata and so on, I can see almost all with these "visually" abbreviatons around a thumb, so my eyes can see very quickly the status of an image or a whole event (stack). Colors does also help me.

I guess, I am almost finnished with my workflow, if this is the case, I will decide above the colors of such visually hints or maybe also use some individual icons, what is also possible.

[attachment deleted by admin]
Best wishes from Switzerland! :-)
Markus

StanRohrer

Sinus, you are a long way ahead of me with your customization! ;-)  I would like a tutorial on how to display the file size (Mbytes) and dimensions (x pixels x y pixels) as you have shown in your above screen captures. Thanks!

jch2103

See above (https://www.photools.com/community/index.php?topic=3352.msg22297#msg22297) for an earlier version of Markus' template. If you load this custom layout and then edit it, you can see the various formatting steps he used. An excellent example for the rest of us!

Perhaps he'll upload the current version?
John

sinus

#26
Hi Stan and jch2103,

Thanks for your postings.
Like jch2103 suggested, I attach the newest layout here, you must simply change the extension from txt to imfwl.

My layout is still not finished, if I think, it is finished, maybe I try to post a kind of manual, thought the help-pages of IMatch are really superiour.

[attachment deleted by admin]
Best wishes from Switzerland! :-)
Markus

jch2103

John

StanRohrer

I figured out the file type change and did get it to work. This was another of the many iMatch settings and I didn't even know this are existed. So I have made another advancement and customized my configuration. Thanks!

sinus

Quote from: zematima on May 07, 2015, 03:51:36 PM
Hi sinus:
I read the posts you made and i downloaded your layout.
When I try to use it it works fine for the type of the file (jpg,etc). the number of keywords , but the ATT and the G1,G2,etc features don't work.(2.2.jpg)

The result in the file is 0 which is right.(1.1.jpg)
The code :
<Run FontFamily='Lucida Console' FontSize='9pt' Foreground='#000000' Background='{File.Width|is:0,#FF00FF,#FBD62A}'> {File.Width|contains:1',G1;contains:2',G2;contains:3',G3;contains:4',G4;contains:5',G5;is:0,00}</Run>

The result is in a yellow background with the number 1600 (this belongs to the size of the file) but it should be G1.(1.1.jpg)

Thanks in advance.
JRosa.

Hi JRosa
You touched a problem in my file layout, what I could not solve until now.

The idea is this:
Images has some pixels, like
160 x 200
1'600 x 1'200
3'008 x 2'000
5'222 x 4'577

Now If I see this pixels under my images, it takes some thent's of seconds for me, to realize, how big the images is (means how many pixels, is it small or big).

Hence I thought, it is quicker to realize this, if we have nice formated "abbreviations" like
G1 means pixels from 1'000 to 1'999
G2 means pixels from 2'000 to 2'999
G3 means pixels from 3'000 to 3'999
G4 means pixels from 4'000 to 4'999
...

So, if a file has G3 I know quickly, that this file is from "medium" size.
A G1 is a small image and so on.

Now, how can I do this? I did it with the code

<Run FontFamily='Lucida Console' FontSize='9pt' Foreground='#000000' Background='{File.Width|is:0,#FF00FF,#FBD62A}'> {File.Width|contains:1',G1;contains:2',G2;contains:3',G3;contains:4',G4;contains:5',G5;is:0,00}</Run>

My pixel numbers has always a ' in the number, like 1'600 or 5'434 and so on.

Hence I thought, ok, I take the "value" before the ' to make the difference.
So the code means, if the width contains 1' then this file must have a pixel-width between 1'000 and 1'999, and the text G1 will be written.
If the file contains 2' then it is a G2 and so on.

This works fine from 1'000 pixel and more.
But what, if a number has not this ' in the number?
Or, the value is under 1'000, this means for example 700 pixel?

If the file has 700 pixel, then in my layout the number 700 will be written.

This is not nice, but I have not a lot of images under 1'000 pixel, hence it is not that bad for me.

And the code is not very good, I think. I would also like to make smalle gaps between the numbers.

Means, I would like to make a difference between, for example

0 - 500 pixels
501 - 1000
1001 - 1500
1501 - 1999
and so on.

But I am not able to formating the variables for this.
Help would a kind of "is bigger then".

Like if the pixel-width is bigger than 1000, print this.
If it is bigger than 1500, print that.

At the moment I have no solution for this. If a user or you have an idea, please write it here ;)

In your example, so far as I can see, is the problem, that your number is NOT 1'600, but 1 600.
This means, it contains NOT 1'

I do not know, if it works with a space, I guess not.
If you really want have this, they you could, I think, formating the 1 600 so, that it will be also 1'600 and hence the G1 would appear.

But maybe a user has a better idea to reach the goal, I think, this "code" of me is a bit clumpsy.

So this for now for the G1, G2 - stuff, the Attributes - problem I describe later.

JRosa, I hope, you don't mind, I copied your 2 files here also (Attachement 1), attachemet 2 is from me.

best wishes, Markus

[attachment deleted by admin]
Best wishes from Switzerland! :-)
Markus

sinus

Quote from: zematima on May 07, 2015, 03:51:36 PM
Hi sinus:
I read the posts you made and i downloaded your layout.
I would like to have the code for the Attributes (this file has Attributes) and the ATT doesn't appear.(This is a very good feature because you can see immediatly if a file has attributes or not).

Yep, I think also, that this is a very good thing, we can see very quickly, what file has Attributes.
In my case, I want see, this image I have to create a bill or when the bill is done.
The variables are really almost without limits, except some things to calculate or comparing, like explained in the post above).

Quote
In file 2.2.jpg what does it mean:
no (near the file name).
06.24.C0 left bottom (The date without the Year?)
Thanks in advance.
JRosa.

Hm, not sure, if I understand fully.
The no (see also my attachement above in the posting) means FOR ME, this image is not finished yet (Metadata is missing or not complete).

If there is an OK, this means for me, all informations for this file is finished. The RN (green) means, this image has a bill, what have been sent out.
G1, G2 and so on is clear.

In the second line of my attachement above the 1 and 15 means the amount of keywords.
The blue ST means this file is stacked (what I like to see).

In the footer, the first line is the headline and the city
In the second line the caption (description).

In the 3 line left the date of the image, when it was taken (same like in the name 20150330) but other formatted, to read easier.
On the right of the 3 line the exakt pixels.

Left in the 4 line the MegaBytes and on the right the possible output with (I believe) 300 dpi.

So let me say finally, that I hat still not the time and peace  ;D to look very carfully at my layout.
I want to create it better, specially the "icons" of the attributes.

MAYBE I will also create some real icons (instead G1 or ST ...).
When you look at the original icons of Mario, like the flags or dots and so on, such icons can be interpreted visually (I believe) very quickly.
That is why I want some informations not as text, but as abbreviations or icons.

Mario has also not simply written "flag red" or "pin green", but created icons, I think, with very good reasons.

So, I think, at the end of this year, my layout will looking not more exactly the same like now.

And since Mario does quite often expand the variables - possibilities (like protected images), the possibilities to displaying data around a thumb seems really to be almost not limited.  :D

Best wishes from Switzerland! :-)
Markus

zematima

#31
Good morning Markus:
Thank you so much for your explanation.
Of course you can use my images.
I understand the theory of the file size (between 1000 and 1999 should be G1,...) the problem is that the code doesn't work for me because it puts for instance 1 600 instead of G1.
But this not a big problem.
Counting the passwords is working fine.
Showing the file type is also working.
For me what really is important is to see if the file as attributes.
So if I saw ATT I know that the file has attributes.
Digging I saw that the code is something like {File.AT.Anmerkungen.RG-norm|hasvalue:#FDB73E;default:#FFFFFF}
Anmerkungen I think is the name ot the attributes set and then i can put the fields that belong to that set.
But what I want is only if the file has attributes (whatever are the name or the fields). Then if I want to see them I would open the panel attributes.
Maybe something like if it is 1 means the file has attributes so put ATR if it is 0 don't put anything.
Can you gave me same ideas or even better write the code?
Thanks in advance,
Best regards,
JRosa.




sinus

Hi JRosa

Yes, in the beginning I wanted also only this:

IF a file has attributes, this should be displayed above or under the thumb.
But I have several fields in Attributes, hence sometimes I have an entry in this field, sometimes in another.
If I would have only one field, I could have a code like "contain" or so, means, if the field contains something (or hasvalue), then display yes, else no.

But I have different fields, like you

So I did simply this: I created in my Attributes set a field (yes/no) and called this for example "entry".

This field I put at the start of the Attributes. So I made it a habit, that as soon as I added some entries in an Attributes-field, I did check this yes/no-field (entry) on!
Does not matter, what or where I have in the other field, but this means for me, every file, what has an Attributes-entry, has this field "entry" checked on.

Hence I could make my code like this:

<Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000' Background='{File.AT.Anmerkungen.entry|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Anmerkungen.entry|cast:int; replace:0==;replace:1==ZE}</Run>

what means, if the field "entry" is checked, we have an entry, replace 1 with ZE and display this.
If the field is not checked, replace the 0 with nothing, hence display nothing.

I would like it more, if we could have a variable, what says, IF there is an entry in the Attributes, in whatever field does not matter, then return a value from 1.
If this would be the case, we must not create a special field, like I wrote.

But maybe it is possible, and I do simply not know it, if Mario had an idea or even an existing variables to use, I would not be very astonished.   ;D Because Mario is Mario, we do never know!  8)

So, finally, I would say, my solution works fine, but is a bit "handmade" (handgestrickt).
Best wishes from Switzerland! :-)
Markus

zematima

Hi Markus:
Thank you for your answer.
I created an Attribute set called Teste and the fields :
Name, Address and Check.
This last one is an YES/NO field.
So when I check this field the code responds putting ATR on the window.
Here is the code:
<Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000' Background='{File.AT.Teste.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste.Check|cast:int; replace:0==;replace:1==ATR}</Run>
But if I have other set of attributes)?
For instance having (always) the same field Check and a new set called Teste1, the code should be (both for set Teste and Teste1):
<Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000' Background='{File.AT.Teste.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste.Check|cast:int; replace:0==;replace:1==ATR}</Run>
<Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000' Background='{File.AT.Teste1.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste1.Check|cast:int; replace:0==;replace:1==ATR}</Run>
I tried this code and it didn't work for the set Teste1.(worked fine for Teste, it showed the ATR on the file with the set Teste but it didn't show the ATR on the file with set Teste1)
Because you can have several sets with the same field (Check) and then when you want to add an attribute to a file you choose set Teste and put the field Check marked. For the other file you choose set Teste1 and put the field Check marked.
So to have the message for different set names all of them with the same field Check what code should we have?
I tried this other code with no luck:
<Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000' Background='{File.AT.Teste.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste.Check|cast:int; replace:0==;replace:1==ATR}
Background='{File.AT.Teste1.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste1.Check|cast:int; replace:0==;replace:1==ATR}
</Run>
Thanks in advance,
Best regards,
JRosa.


Mario

QuoteI would like it more, if we could have a variable, what says, IF there is an entry in the Attributes, in whatever field does not matter, then return a value from 1.

That's doable. Give the hasvalue function a try.

For example, I have an Attribute set which has attributes Note and Comment.
If there is a Note I want to display it. Else the Comment.

So I use

{File.AT.Notes.Note|hasvalue:{File.AT.Notes.Note};default:{File.AT.Notes.Comment}}

If Note has a value, {File.AT.Notes.Note} is emitted. Else the default is used, which emits {File.AT.Notes.Comment}.
You can also nest this, when you want to do this for more than 2 Attributes.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Hi JRosa and Mario

Thanks for your input, Mario.
I will try that. Though I have quite a lot of attributes fields and at the moment 2 sets.

I believe, JRosa has even more sets.

I will try to nest the fields, like you wrote, but it will give quite a long variable.  :o Hope, IMatch can handle it.

It would be fine of course, if we could a variable, where we could say:

if there is a value in a set, then return 0 or 1.

But I have to try first. JRosa, maybe you can also try, what Mario wrote.
Let's look, maybe we can find a solution.
Best wishes from Switzerland! :-)
Markus

Mario

QuoteIt would be fine of course, if we could a variable, where we could say:

if there is a value in a set, then return 0 or 1.
Please add a feature request if you suggest a new variable.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

zematima

Hi all:
Yes I am tryimg to do what I need reading the examples and trying to adapt to my needs.
I don't have so many sets...
But I would like to know how can we approach this challenge:
For instance I have 3 files (1 , 2 , 3) and two sets (A and B) both sets have the field Check (Yes/No).
Files 1 and 2 belong to set Teste with the field Check marked. File 3 belongs to Teste1 with the field check marked.
If I put this code:
<Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000' Background='{File.AT.Teste.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste.Check|cast:int; replace:0==;replace:1==ATR}</Run>
or the one Mario gave:
File.AT.Teste.Check|hasvalue:{File.AT.Teste.Check};default:{File.AT.Teste.Check}}
These are the results:
On file 2 an 3 I get an Yes which is true and on file 1 a No, which is also true because we are leading with Set Teste.
Now how can I put Teste1 on the code?
Because if I manage to put Teste1 working (with Teste) the 3 files should be Yes.(1 and 2 because they belong to set Teste and file 3 because it belongs to set Teste1)
In other words if we only have one set this works very well.
Of course Markus solution would be easier because we could write if there is a values in a set (wharever it is - Teste or Teste1) then return 0 or 1.
Lets see what we and the othrt users can suggest.
Have a nice weekend.
Best regards,
JRosa.





sinus

Hi JRosa

I am not sure, if I understand.
If you have two sets, both sets has a field "Check", then you could simply double your code, means:

<Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000' Background='{File.AT.Teste.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste.Check|cast:int; replace:0==;replace:1==ATR}</Run><Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000' Background='{File.AT.Teste1.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste1.Check|cast:int; replace:0==;replace:1==ATR1}</Run>

And now, if you check a file only with the first set, ATR would appear.
If you check a file only with the second set, ATR1 would appear.

And if you check a file with set 1 AND set 2, then ATR and ATR1 would appear.

Is this not what you want?

Best wishes from Switzerland! :-)
Markus

zematima

Hi Markus:
Thank you for your answer.
That's precisely what I was looking for.
If you see in one of my previous posts I tried this code:(is the same as yours except...)
<Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000'
Background='{File.AT.Teste.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste.Check|cast:int; replace:0==;replace:1==ATR}</Run>
<Run FontFamily='Lucida Console' FontSize='10pt' FontWeight='Bold' Foreground='#000000'
Background='{File.AT.Teste1.Check|default:#FFFF03;hasvalue:#F8B8BF}'>{File.AT.Teste1.Check|cast:int; replace:0==;replace:1==ATR}</Run>
The "only" thing I didn't think was that I couldn't give the name ATR for both sets.
And the difference between a working code and a not working code was a 1.(ATR and ATR1)
Thank you very much for your time and patience.
Best regards,
JRosa.



sinus

Thanks also, JRosa

So, if I understand you correct, everthing is now ok for you!?

I thought about writing a feature request, that we could a variable for attributes, what would return a true (1 or yes), if there is an entry - independent in which field - in an attribute set.

But because it is not a problem for me, I leave it, Mario has enough to do, I think.  ;D

As you know, I solve it like I describe it and apparently you do the same: I created a field in every set with yes/no.
As soon as do an entry in this set, I click on this field.

So every set with an entry must have checked this field.
Hence I can ask with a variable only this field (one field per set) and I get a correct yes or no from IMatch.

Quite good.
And very good is also, that we can formatting these variables so good.

Have fun and a good weekend!
Best wishes from Switzerland! :-)
Markus

sinus

Quote from: Mario on May 08, 2015, 03:12:45 PM

For example, I have an Attribute set which has attributes Note and Comment.
If there is a Note I want to display it. Else the Comment.

So I use

{File.AT.Notes.Note|hasvalue:{File.AT.Notes.Note};default:{File.AT.Notes.Comment}}

If Note has a value, {File.AT.Notes.Note} is emitted. Else the default is used, which emits {File.AT.Notes.Comment}.
You can also nest this, when you want to do this for more than 2 Attributes.

So this works really!  :D Thanks, Mario.

In my example, I have for example sometimes to calculate for a bill the amount of kilometer.
I have there two possibilities, either I use the exact amount of kilometers, say 55 KM.
So I have 3 fields in Attributes:

1) Amount of KM
2) CHF per KM (CHF is a currency)
3) Total of this: field 1 * field 2

But sometimes I have also made "a deal" with the client, where I say, it does not matter, how many KMs I drive, I do a sum of, say 80 CHF, on the bill.
This gives the 4 field:

4) CHF overall

So, in pracise, for the bill is important either field 3 or 4, only 1 can have a sum. This means for example:

1) 55
2) 0.75
3) 41.25
4)

Here the correct sum will be billed, CHF 41.25.
The other case is:
1) 55
2)
3)
4) 40.00

Here 40 CHF goes into the bill, because we made this deal, independent of the real KMs.
And here comes the variables into play.
And this line:

{File.AT.Verrechnung.KM-total|hasvalue:{File.AT.Verrechnung.KM-total};default:{File.AT.Verrechnung.KM-pausch}}

If KM-total (field 3) has a value, take it, if not, then take the "deal" (field 4).
Works great.

(BTW: that is why I asked once for some basic counting of attributes, but I done all calculations now by a script).)
Best wishes from Switzerland! :-)
Markus

sinus

Quote from: sinus on September 10, 2014, 02:08:45 PM
My question: Is it possible, to create a formatting, something like
"if pixel is bigger then 2000 pixel high, then the value is true, else not" and also
"if date is older than 6 monthes, the value is true, else not".



So, after all, with the newest version, 5.4.12, this is now possible, with your new created variables, thanks a lot!
(Kommt Zeit, kommt Rat  ;D )
Best wishes from Switzerland! :-)
Markus

Mario

The next release has {File.LongEdge}, {File.ShortEdge} and  {File.Megapixels} variables which should make this even easier.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Yes, even cooler!

The limit is not reached, IMatch goes further and further!  :D
Best wishes from Switzerland! :-)
Markus

sinus

This is only a question, maybe someone knows a solution ... or it works simply not, such a "nesting".

I have two different variables, and both works like a charme.

The first:
{File.MD.description|numcomp:gt,38,{File.MD.description|substr:0,38} ...,{File.MD.description},length}
This is taken from the helpfile, and it is a quite new variable.
It does shorten a field, here the description. If it is longer then 38 letters, then it shows the three dots ...
if not, the whole description will be displayed.
Very nice. (see attachement 1)

The second variable is maybe 1 or two versions "older", it helps us to protect some text, if the file is protected.
{File.Protected|cast:int;is:0,{File.MD.description};is:1,Kundenbild}
If the file is not protected, the description will be displayed.
If it is protected, then the word "Kundenbild" will be protected.
Also VERY useful. (see attachement 2)

Now you guess what I am asking for?
;D
I have tried to simply "nesting" both lines, but I have no success.
My try ...

{File.Protected|cast:int;is:0, {File.MD.description|numcomp:gt,38,{File.MD.description|substr:0,38} ...,{File.MD.description},length};is:1,Kundenbild}

... and others, what I have tried, works not, see attachement 3.

Maybe this is simply a limit for "nesting" or has someone a clever idea?



[attachment deleted by admin]
Best wishes from Switzerland! :-)
Markus

RalfC

Quote from: sinus on June 11, 2015, 12:49:04 PM
Maybe this is simply a limit for "nesting" or has someone a clever idea?

I'm not sure if you consider it as clever idea or not:

I am used to the fact that the amount of opening brackets should match the amount of closing brackets but in the text you have written that is not the case:
How could IMatch know where the "then"-clause ends?

Can you try something like (not sure if I put the closing brackets to the right places)
{File.Protected|cast:int;is:0, {File.MD.description|numcomp:gt,38,{File.MD.description|substr:0,38} ...},{File.MD.description},length};is:1,Kundenbild}}

Regards,
Ralf

sinus

Thanks, Ralf, for jumping in!  :D

Unfortunately your code works also not.
But your hint about brackets is interesting, so I can try also some more things ... though I have tryed a lot!  :-\
Best wishes from Switzerland! :-)
Markus

sinus

Hi Ralf

I have tried again, so "nest" these variables into one.
I had no luck.

But to be honest, I think, this is simply not possible.
I mean, we can really do a lot with variables, and although it is possilbe, to get really a lot of output, everything is not possible.

But finally, I have a lot of other possibilities and this actual question is at the end only a "design-stuff-problem", what is really not important.
I am happy enough, like it is now, but Mario does not end  ;D he often brings with a new version also new, interesting variables.

I do not know, where the heck he takes always such new variables! And he creates not only new variables (and others), he does really always take care, that the help-file is up to date, and creates also new examples with the new variables.
This is really astonishing and admirable!  :D
Best wishes from Switzerland! :-)
Markus

Mario

I was looking into an issue with multiple levels of nesting in conjunction with preplace and markup. My oh my, these variables have become complex. Way more than I ever anticipated when I started to design and implement this feature.

Anyway, your usage of is was also touched by the issue (wrong parsing of nested variables multiple levels deep). Complex stuff. But it has to work of course.

The next release will produce the correct result for this:

{File.Protected|cast:int;is:0,{File.MD.description|numcomp:gt,38,{File.MD.description|substr:0,38}...,{File.MD.description},length},Kundenbild}

Note that I just used the 'else' case of if here. You don't need to use multiple is statements, each is has an else so one 'if' is usually sufficient.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook