Need help with a renaming script when using two cameras

Post Reply
lulumine
Posts: 36
Joined: 23 Aug 10 16:09
Location: La Rochelle, France

Need help with a renaming script when using two cameras

Post by lulumine »

I have two similar camera in the family, and would like to rename their files differently to be sure to address the right one in PSU.
An idea should be to use exif:CameraModel ans exif:CameraSerialNumber in the renaming script, but the whole strings seems too long in the custom thumb view (or everywhere...).
My goal is to use only 3 digits (NK1, NK2 here), giving to me the possibility to have 10 Nikon Cameras in my catalog, which seems to be enough.
How can I do that (IF..THEN..ELSE in script language...) ?
fyi, my renaming script is :

Code: Select all

%yyyy-%mm-%dd_%exif:Model
%code Input := StrTran (Input, 'NIKON D', 'D'); %/code
(
%code result := AddLeadingChars( Midstr( '%FileName' , WideTextPos( 'DSC', '%FileName' )+3, Length( '%FileName' ) - Length( RightStr( '%FileName', WideTextPos( 'DSC', '%FileName' )))), '0', 3, False ); %/code
)%exifmakernote:ShutterCount_
%code result := '%EventName'; %/code
.%FileExtension
[update Hert; changed the title to better represent the content]
Olivier PSU v2.2.5.1044 / Win7x64 - Intel core i7 950@3,7GHz-RAM6Mo
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: renaming script

Post by Hert »

Here's a sample that could help you further:

Code: Select all

%yyyy-%mm-%dd_%code 
result := WideUpperCase('%exif:Model');
if result = 'NIKON D100' then
  result := 'NK1'
else if result = 'NIKON D800' then
  result := 'NK2';
%/code.%FileExtension
Hope that helps
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
lulumine
Posts: 36
Joined: 23 Aug 10 16:09
Location: La Rochelle, France

Re: renaming script

Post by lulumine »

Thank you very much!
But if I have two D300, the only one exif:CameraModelI is not enough significant to name properly my files (even if mixed with %exif:ShutterCount), because I will have thousands & thousands of couple of pictures with the same 2 values...).
Ok, the date can help... but If I want to be really, really sure to never have 2 files nammed the same, I need to discriminate the 2 camera.
Do we have a standard exif value (meaning fullfilled by all the manufacturers) wich can be used for that (%exif:BodySerialNumber)?
Olivier PSU v2.2.5.1044 / Win7x64 - Intel core i7 950@3,7GHz-RAM6Mo
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: renaming script

Post by Hert »

Something like this:

Code: Select all

%yyyy-%mm-%dd_%code 
result := WideUpperCase('%exif:Model');
if (result = 'NIKON D100')  then
  result := 'NK1'
else if (result = 'NIKON D800') then
  result := 'NK2'
else if (result = 'NIKON D300') and ('%exif:CameraSerialNumber' = '123456789') then
  result := 'NK3'
else if (result = 'NIKON D300') and ('%exif:CameraSerialNumber' = '987654321') then
  result := 'NK4';
%/code.%FileExtension
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
lulumine
Posts: 36
Joined: 23 Aug 10 16:09
Location: La Rochelle, France

Re: renaming script

Post by lulumine »

Thanks again, Hert, it works fine.
So, I've one question more (!) :
Can I use in the renaming script informations provided by the metadata profile which can be attached to the running import profile?
Olivier PSU v2.2.5.1044 / Win7x64 - Intel core i7 950@3,7GHz-RAM6Mo
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: renaming script

Post by Hert »

Can I use in the renaming script informations provided by the metadata profile which can be attached to the running import profile?
Sorry, but I'm not sure if I fully understand the question.
Is your question if you can use such metadata rename scripts in the Import module then the answer is yes.
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
lulumine
Posts: 36
Joined: 23 Aug 10 16:09
Location: La Rochelle, France

Re: renaming script

Post by lulumine »

Yes, I have to be more clear!
I want to append a trigramme representing the creator of the pictures to my renaming rule. And It's depending on the creator which has been already assigned (when ingesting files already tagged) or not (forbidden during the first ingest, or first import of new files from digital camera).
In order to manage both cases in the same rule, I can use a detail profile :
=>[ external image ]
in which I have decided
    about the creator field to be only processed when empty :
    =>[ external image ]
    So, my new question is :
    In my renaming script, If I test the value of the creator's name field, will it be caught before applying the detail profile (providing the original value in the file) or after (providing the overwritten value from the profile) ?
    Hope to give you a better understanding !?
    Olivier PSU v2.2.5.1044 / Win7x64 - Intel core i7 950@3,7GHz-RAM6Mo
    Hert
    Posts: 7870
    Joined: 13 Sep 03 6:24

    Re: renaming script

    Post by Hert »

    A detail profile from the Import Module is applied after copying the file. So the content of the detail profile in the Import Module can't be used to rename the file in the Import Module...well it can be used but the value will still be whatever is in the ingested file.

    Hope I understood the question this time
    This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
    lulumine
    Posts: 36
    Joined: 23 Aug 10 16:09
    Location: La Rochelle, France

    Re: renaming script

    Post by lulumine »

    Answer is clear : I will have to proceed in 2 steps (1/ingest, 2/rename)
    Thank you very much.
    Olivier PSU v2.2.5.1044 / Win7x64 - Intel core i7 950@3,7GHz-RAM6Mo
    Hert
    Posts: 7870
    Joined: 13 Sep 03 6:24

    Re: renaming script

    Post by Hert »

    Tip; you can run a post-import batch that does a rename. Maybe that could help you to keep it all as a single step. BTW; I noticed that the Batch setting is in the Copy section of the Import Module, but it should be in the Import section. That will be corrected in the next build
    This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
    lulumine
    Posts: 36
    Joined: 23 Aug 10 16:09
    Location: La Rochelle, France

    Re: renaming script

    Post by lulumine »

    Than you very much Hert, and one step beyond (!) :
    Assuming my renaming rule is now using some tests with, of course, some rejections (empty fields, unexpected values,...), it should be suitable to list them by 2 ways : 1/a log file, 2/a warning message at the end of import process.
    Is it possible through the setup of the import process? Does it exist examples of scripts for :
    1) create/append/display a log file
    2) temporarly store informations during iterative job, and sumurize them in a combo box at the end.
    Many thanks in advance.
    Olivier PSU v2.2.5.1044 / Win7x64 - Intel core i7 950@3,7GHz-RAM6Mo
    mphillips
    Posts: 240
    Joined: 31 May 07 11:02
    Location: Parkwood,Johannesburg,South Africa

    Re: renaming script

    Post by mphillips »

    Hi

    A late reply :-)

    What I have done is create a "set" of labels - having a separate label for each of the photographers in the family.

    And that label I assign values into the Detail Profile under Creator, etc..

    Then on import I assign that label to the set of images to import (I generally only import images from 1 camera at a time) and then as Supreme assign the labels, and syncs the file, it populates the Detail Fields.

    It worked far better for me than having "if" statements in the detail profile to populate the fields.

    Thanks

    MIkeP
    Mike Phillips
    http://www.mikeandmorag.co.za
    D850, NX Studio, Supreme, Lightroom
    Post Reply