#1 2010-12-29 18:32

BadBoy
Member
Registered: 2010-05-08
Posts: 3

Conditional Renaming: use modified date if no exif date

I'd like to create a ReNaming rule based on certain conditions. When I download Images and Movies from my camera into the same folder I use ReNamer to change the FileName.  I have to run it twice because I use the [DatePictureTaken] to use on the Images but have to use the DateModified for Videos because there isn't the EXIF field of [DatePictureTaken] for the video clips. Is there a simple bit of Pascal script I can use that basically checks for the existence of the EXIF data and if it's not there then uses the DateModified instead.  If there's a cleaner way of doing this I'd be keen to learn how to achieve this. 

Many Thanks.

SJV

Offline

#2 2010-12-30 13:29

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Conditional Renaming: use modified date if no exif date

I guess you can use CalculateMetaTag() and check if the return value for a particular tag is null/empty. If so, use the other tag.

Offline

#3 2011-01-03 11:02

SafetyCar
Senior Member
Registered: 2008-04-28
Posts: 446
Website

Re: Conditional Renaming: use modified date if no exif date

I have this for me, take a look at it, I think it might help.

var
  Date: WideString;

begin
  Date := CalculateMetaTag(FilePath, 'EXIF_Date');

  If (Date='') then Date := CalculateMetaTag(FilePath, 'File_DateModified');

  FileName := '[' + Date + '] ' + FileName;
end.

If this software has helped you, consider getting your pro version. :)

Offline

Board footer

Powered by FluxBB