Author Topic: Ingest filename and rename question.....  (Read 1457 times)

Offline Dino

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Ingest filename and rename question.....
« on: April 19, 2024, 08:48:30 PM »
My goal is to make a record of the original filename during ingest and before renaming and also to note the new filename as I intend photo mechanic will write it, for example I would write into a metadata tag the following...

Original Filename:{filename}, New Filename:{datesortdash}~{timesortlong}~{filenamebase}~[just say something Names-Location-Whats Going On].xxx

i wish the .xxx was the file extension of the file being processed but at this time i do not know how to do that.

for the rename command i would also use {datesortdash}~{timesortlong}~{filenamebase}~[just say something Names-Location-Whats Going On]

A second question would be after i write some keywords to the file via the Metadata template would there be a way to do a filerename ond only REPLACE [just say something Names-Location-Whats Going On] in the filename to [{keywords}]  I do not care to do a complete filerename after adding keywords, i only want to change/replace whats in the square brackets with the keywords field.

Any Ideas?

Thanks,
Dino

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Ingest filename and rename question.....
« Reply #1 on: April 21, 2024, 09:13:12 AM »
Dino,

My goal is to make a record of the original filename during ingest and before renaming and also to note the new filename as I intend photo mechanic will write it, for example I would write into a metadata tag the following...

Original Filename:{filename}, New Filename:{datesortdash}~{timesortlong}~{filenamebase}~[just say something Names-Location-Whats Going On].xxx

i wish the .xxx was the file extension of the file being processed but at this time i do not know how to do that.

{filename:-3} will give you the extension.  Though if the extension has four characters, the leading letter will not be extracted.  You'd have to use {filename:-4}.  If you have mix of 3 and 4 letter extensions, there is no solution that will work for all.

https://docs.camerabits.com/support/solutions/articles/48001077381-variable-substring-extraction

A second question would be after i write some keywords to the file via the Metadata template would there be a way to do a filerename and only REPLACE [just say something Names-Location-Whats Going On] in the filename to [{keywords}]  I do not care to do a complete filerename after adding keywords, i only want to change/replace whats in the square brackets with the keywords field.

The Find and Replace panel can find and replace in filenames (it renames the file).  That said, if you have a lot of keywords, then you could run out of space in the filename (255 letters is the maximum on most filesystems.)

https://docs.camerabits.com/support/solutions/articles/48001143485-find-replace

-Kirk