condition: "date taken" field is blank

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

condition: "date taken" field is blank

Postby iancognito009 » Fri Mar 11, 2022 10:14 pm

Hi all.

Thanks in advance for any guidance you can offer.

I'm trying to rename and de-dupe my photos and videos.

Most photos have the exif "date taken" field, but I would like to alternately use, in the new filenames, the file "date modified" field when the "date taken" is blank.

How would I phrase this in javascript as a Condition?

Any help is appreciated.

Ian
iancognito009
 
Posts: 2
Joined: Fri Mar 11, 2022 10:05 pm

Re: condition: "date taken" field is blank

Postby Luuk » Sat Mar 12, 2022 11:58 am

If talking about the Filters(12) "Condition", then it can look like... !fileProperty('exif:DateTimeOriginal')
In the javascript window, its more like... if (!fileProperty('exif:DateTimeOriginal')) {renaming-code here}
The "!" just says there can "not" be any exif:DateTimeOriginal.
Luuk
 
Posts: 692
Joined: Fri Feb 21, 2020 10:58 pm

Re: condition: "date taken" field is blank

Postby iancognito009 » Sat Mar 19, 2022 9:34 pm

Thanks for the response.

I may have sounded more knowledgeable than intended.

I appreciate the nudge in the right direction, and I tried to figure out how to complete the script, bit I simply don't know how.

If the exif Date Taken field is blank, and that is the core of my renaming scheme, is there a way to have BRU use the File Date (Modified) in the alternative?

In plain english:

If exif date taken exists
Then write exif date taken as filename (as defined in Custom format under Auto Date?)
If exif date taken does NOT exist
Then write file property date modified as filename (as defined in Custom format under Auto Date?)

Help is very much appreciated.

BTW, the answer can be: "if there is no exif date taken, Auto-Date defaults to ____________________"

Thanks all.

Ian
iancognito009
 
Posts: 2
Joined: Fri Mar 11, 2022 10:05 pm


Return to Javascript Renaming