Need help with Variablen formatting

Started by AnaDia, September 17, 2014, 02:51:22 PM

Previous topic - Next topic

AnaDia

I have a files with several categories assigned.

20120115_125803_#0001_v01.jpg

010_digital-photo.net|KoelnerZoo_2012-01
600_Unterwegs|Events-Tagesausfluege|Zoo-Köln_2012-01

I like to get the changing  category name at the position of "KoelnerZoo_2012-01" to create directory and filenames during batch processing. I thought, that the folloging variable should give me "KoelnerZoo_2012-01", but it doesn't.

Results in "Var Toy App":

{File.Categories.Direct|level:1}
Like expected: "KoelnerZoo_2012-01;Events-Tagesausfluege"

{File.Categories.Direct|level:1;index:first}
Expected: "KoelnerZoo_2012-01"
But get: "KoelnerZoo_2012-01;Events-Tagesausfluege"

{File.Categories.Direct|level:1;limit:1}
Expected: "KoelnerZoo_2012-01"
But get: "KoelnerZoo_2012-01;Events-Tagesausfluege"

What am I doing wrong?


Mario

#1
May be related to the fixed bug (for next version)

https://www.photools.com/community/index.php?topic=3394.0

I just checked.

{File.Categories.Direct|level:1;limit:1} will return only one category. So that's fixed in 5.2.8 (the limit/index were not working for category variables).

But for your example, there is another way. The Categories.Direct variable always returns all categories, so if you assign a file to 10 categories, it will return 10 categories. If you only want to use a specific category for your folder name, try using a filter, e.g.

{File.Categories.Direct|filter:KoelnerZoo_2012-01;level:leaf}

or, more general:

{File.Categories.Direct|filter:^600_Unterwegs|Events-Tagesausfluege;level:leaf}

Which looks at categories starting with 600_Unterwegs|Events-Tagesausfluege and then returns only the the leaf level (bottom level).


-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

AnaDia

I didn't describe good enough, what I like to do, but you answered my question. So, if the limit/index isn't working for category variables now,  I will wait for 5.2.8 and try again.

...
Ah great! You gave me the hint, what to change in the category structur, so that I don't need limit and index, but only filter and level and now I get the result that I need. I saw the format option "filter" in the help file before, but hadn't the right idea how to use it  :D