Need help with a renaming script when using two cameras

Post Reply
lulumine
Posts: 41
Joined: 23 Aug 10 17:09
Location: La Rochelle, France

Need help with a renaming script when using two cameras

Post by lulumine » 06 Apr 14 19:00

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: 21344
Joined: 13 Sep 03 7:24

Re: renaming script

Post by Hert » 07 Apr 14 8:16

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 which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

lulumine
Posts: 41
Joined: 23 Aug 10 17:09
Location: La Rochelle, France

Re: renaming script

Post by lulumine » 07 Apr 14 15:18

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: 21344
Joined: 13 Sep 03 7:24

Re: renaming script

Post by Hert » 07 Apr 14 16:07

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 which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

lulumine
Posts: 41
Joined: 23 Aug 10 17:09
Location: La Rochelle, France

Re: renaming script

Post by lulumine » 09 Apr 14 8:24

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: 21344
Joined: 13 Sep 03 7:24

Re: renaming script

Post by Hert » 09 Apr 14 8:44

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 which means that users post questions here for other users.
Feature requests, change suggestions, or bugs can be logged in the ticketing system

lulumine
Posts: 41
Joined: 23 Aug 10 17:09
Location: La Rochelle, France

Re: renaming script

Post by lulumine » 09 Apr 14 12:48

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 :
=>Image
in which I have decided
    about the creator field to be only processed when empty :
    =>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: 21344
    Joined: 13 Sep 03 7:24

    Re: renaming script

    Post by Hert » 09 Apr 14 15:21

    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 which means that users post questions here for other users.
    Feature requests, change suggestions, or bugs can be logged in the ticketing system

    lulumine
    Posts: 41
    Joined: 23 Aug 10 17:09
    Location: La Rochelle, France

    Re: renaming script

    Post by lulumine » 09 Apr 14 17:28

    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: 21344
    Joined: 13 Sep 03 7:24

    Re: renaming script

    Post by Hert » 10 Apr 14 11:15

    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 which means that users post questions here for other users.
    Feature requests, change suggestions, or bugs can be logged in the ticketing system

    lulumine
    Posts: 41
    Joined: 23 Aug 10 17:09
    Location: La Rochelle, France

    Re: renaming script

    Post by lulumine » 11 Apr 14 16:42

    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: 2035
    Joined: 31 May 07 12:02
    Location: Parkwood,Johannesburg,South Africa

    Re: renaming script

    Post by mphillips » 13 May 14 12:21

    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
    D800, CNX2, Supreme

    Post Reply