Generating a Ordernumber

Started by picolo, July 10, 2013, 02:31:41 PM

Previous topic - Next topic

picolo

Hi All,

I would like to generate a ordernumber:
[YY]+[first 2 letters of the "extracted" project name in uppercase]+[shuttercount]

Every file I have has a hierarchical keyword that is like
Jahr|2013; Jahr|2013|07-05 test;

the word test is here the "project name"

The Final Order number would look like
13TE12345

Bestellnummer: {File.MD.XMP::photoshop\DateCreated\DateCreated\0|format:YY}{XXX}{File.MD.Nikon::Main\167\ShutterCount\0|value:formatted}

1. What do I have to put in into {XXX}

2. What would be the appropriate place to put in the order number? Til now I have put in the order number always into the description...

Any help is appreciated
Thanks
Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com

Mario

One quick idea:

Setup a numeric global variable (Edit > Preferences > Variables) and name it OrderNumber. Set it to auto-increment and give it a suitable start value and increment.
Then use this variable in your Renamer preset. The new numformat variable formatting function available from build 5.0.102 will allow you to format your variable to a minimum width, e.g. minimum 3 digits.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

picolo

Thanks for your response, I will think about it.

Though, at this time I like to use the shuttercount. This might change when it comes to conflicts with my camera bodies :)
However, I need the extracted project name for other things too, so if it is feasible to extract the name I would be very happy!
Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com

Mario

QuoteI need the extracted project name for other things too, so if it is feasible to extract the name I would be very happy!

I don't understand. You store you project name where? In some metadata tag?
If so, you can just use the corresponding variable and maybe a formatting function like substr to extract the part which holds your project name. Give us a sample so we know what you're dealing with.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

picolo

QuoteYou store you project name where? In some metadata tag?
No, not at the moment but I want to do that in the future for new projects...

For older projects I need to extract the project name from the keywords and then store it somewhere in the the metadata.
And sometimes I need it to create a order number as described in the OP

@keywords|Jahr|2013|07-05 test;
The keywords have been generated automatically with the import and is ALWAYS "Jahr|YYYY|mm-dd projectname"
That's the only way I can reliable retrieve the project name...


BTW I made a copy/paste mistake in my opening post:
it should be Jahr|2013|07-05 test; instead of Jahr|2013; Jahr|2013|07-05 test;

Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com

Mario

So you would need a way to search for a specific keyword and then extract the project name from that keyword to use it in the Renamer?

This cannot be done easily with a variable. You can access keywords via

{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0}

and you can access specific keywords via an index:

{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|index:1}

but you cannot know the sort order of your keywords. If your keyword would always be the last in the sort order, you could use

{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|index:last}

and then combine this with

{File.MD.XMP::Lightroom\hierarchicalSubject\HierarchicalSubject\0|index:last;substr:16,200}

to extract the last part of the keyword.

For

Jahr|2013|07-05 test

this returns

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

picolo

Thanks Mario,

I am at a point that I got kinda what I want :)

To create my ordernumber:
{File.Categories|filter: ^@Keywords|Jahr;Level:leaf;to_upper;substr:11,2}


To extract the whole project name:
{File.Categories|filter: ^@Keywords|Jahr;Level:leaf;substr:11,200}

There are still some inconsistencies that I need to figure out as outlined here:
https://www.photools.com/community/index.php?topic=304.0
Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com