#1 2020-11-17 18:48

dirbik
Member
Registered: 2020-11-17
Posts: 3

Stop after first rule or conditional rules?

Thank you for this great tool. 

I would like to add :EXIF_Date: to file names, however, if the :EXIF_Date: tag is blank or empty then add the :File_DateModified: tag instead.  What would be the easiest way to accomplish this?

Thank you

Windows 10 v10.0.18363
ReNamer Lite v7.2
Rule: Insert
Statement1:  :EXIF_Date:
Statement2:  :File_DateModified:

Last edited by dirbik (2020-11-17 18:53)

Offline

#2 2020-11-19 01:51

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,367

Re: Stop after first rule or conditional rules?

Currently, the only way to apply rules conditionally is to code them up in the Pascal Script rule.

For example, the script below will insert EXIF_Date meta tag if it is not empty, otherwise it will insert File_DateModified meta tag.

var
  TagValue: WideString;
begin
  TagValue := CalculateMetaTag(FilePath, ':EXIF_Date:');
  if Length(TagValue) = 0 then
    TagValue := CalculateMetaTag(FilePath, ':File_DateModified:');
  if Length(TagValue) > 0 then
    FileName := TagValue + WideExtractFileExt(FileName);
end.

Documentation: https://www.den4b.com/wiki/ReNamer:Pascal_Script

Offline

Board footer

Powered by FluxBB