Javascript Syntax for Retrieving EXIF data

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

Javascript Syntax for Retrieving EXIF data

Postby Marcos » Sun Aug 07, 2016 2:09 am

Hi everyone,

I've tried searching on the forum, as well as BRU help file, and I couldn't find a refrence for all possible '%abc' values.

For example, I've learned by accident that %m gives me the month from a date/time attribute, while %M gives me the minutes.

Also, I've found in a post that the condition exif('%mo') will refer to the EXIF Camera Model.

Is there a complete list of these values?

%Y
%m
%mo
%M
%D

As a practical request, I would like to filter my picture files excluding the ones where the EXIF Date Taken is Null.

The only command that didn't return an error message was: exif('taken') != null

But unfortunately it didn't work... :(

Thanks in advance,

Marcos
Marcos
 
Posts: 2
Joined: Sun Aug 07, 2016 1:51 am

Re: Javascript Syntax for Retrieving EXIF data

Postby therube » Sun Aug 07, 2016 2:00 pm

Help (Bulk Rename Utility.chm):

Code: Select all
Add (7)

Add a fixed prefix or suffix to the filename, and certain Exif and ID3 tags.

This section allows you to add a fixed text string to the start of the filename (Prefix) and/or a fixed text string to the end of a filename (Suffix). Useful for renaming MP3 files, where you can prefix all the filenames with the artist or album name. You can also insert a text string at any point in the filename.
You may also choose to add a "Word Space". This will insert a space before any capital letter (except the first character), unless there's a space already there. So, the name "MyHoliday Photographs" would become "My Holiday Photographs".

Note: If you are processing JPEG files, you can also extract and add certain EXIF tags.
These are specified using substitution tags, which you key into the Prefix, Insert or Suffix boxes. The tags supported are:

%a - Aperture

%c - Comments

%e - Exposure

%f - Focal Length

%xb - Exposure Bias

%ma - Camera Make

%mo - Camera Model



Note: If you are processing MP3 files, you can also extract certain ID3 tags (n.b. only V1 and V1.1 ID3 tags are supported). These are specified using substitution tags, which you key into the Prefix, Insert or Suffix boxes. The tags supported are:

%r - Artist

%l - Album

%t - Title

%k - Track Number



Note: You can also specify %z to include the file size (using the format currently specified on the Options menu)


Code: Select all
Custom Date Formats
Top  Previous  Next 
You can append a variety of dates to the file names, either at the beginning or the end. For example, you could prefix the file names with their Modified date, or you could suffix them with the Creation Date. See section 'Auto Date (8)'.
A new feature, introduced in version 2, is the ability to add date and time information in a very flexible manner, using standard formatting codes. The full list of codes is defined below. So for example, if you wanted to suffix the file name with the day name and the month you could enter a custom code of "%a%M".



The full list of codes is:



Code
Meaning

%a
Abbreviated weekday name

%A
Full Weekday name

%b
Abbreviated month name

%B
Full month name

%d
Day of Month (01-31)

%H
Hour in 24-hour format (00-23)

%I
Hour in 12-hour format (01-12)

%j
Day of Year (01-366)

%m
Month number (01-12)

%M
Minute (00-59)

%p
AM/PM Indicator

%S
Seconds (00-59)

%U
Week number of year (00-53), with Sunday as the first day of the week.

%w
Weekday (0-6), with Sunday=0.

%W
Week number of year (00-53), with Monday as the first day of the week.

%y
Year, with no century indicator (00-99)

%Y
Year, with century indicator (e.g. 2004)

%z
Time zone name

%%
Percentage sign




You can enter other text in the file name, and the symbols above will be substituted with the values. So, you could enter a custom value of "Created on %a, %d %B, %Y" to get "Created on Tuesday, 25th March, 2004"
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Javascript Syntax for Retrieving EXIF data

Postby Admin » Mon Aug 08, 2016 2:52 am

In the Filter (12) box, use Condition. For more info see JavaScript Filter Condition in the help file.

Try

exif('taken')>1980

to exclude files with EXIF Date Taken not populated.
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm

Re: Javascript Syntax for Retrieving EXIF data

Postby Marcos » Tue Aug 16, 2016 7:39 pm

Thanks, it worked!!
Marcos
 
Posts: 2
Joined: Sun Aug 07, 2016 1:51 am


Return to Javascript Renaming


cron