ExifTool Custom Columns

:warning: Requires Opus v13. Last update: 2024-01-23.


This add-in generates script columns that show metadata provided by ExifTool. It's the equivalent of Opus' Shell Properties.

How to set up

:one: Download exiftool.exe from exiftool.org and copy it to a convenient place.

:two: Save ColumnExifTool.js.txt to   

%appdata%\GPSoftware\Directory Opus\Script AddIns

:three: Save ExifTool.dop to   

%appdata%\GPSoftware\Directory Opus\Buttons

:four: Turn the ExifTool toolbar on with

Toolbar NAME=ExifTool TOGGLE

or via the Customize dialog.

:five: Click the Configuration button and update the path to exiftool.exe according to step one. Any notation Opus understands is fine.

Done :slight_smile:

How to use

The script comes with about 500 predefined columns. They can be picked from the Folder Format dialog in the Menu toolbar or via

Properties FOLDERFORMAT

The columns can also be turned on via right-click in the column header (Columns > Script > ExifTool).

The Columns menu in the ExifTool toolbar contains buttons that toggle all columns from an ExifTool group simultaneously. There are probably more columns available than you will ever need or want to use. Take the existing buttons as a base and create your own set.

See the next posting for troubleshooting and advanced configuration and use.

Things you might enjoy reading

How to use buttons and scripts from this forum

7 Likes

Upgrading from an older version?

Look here and here.

Troubleshooting

Are you running Opus v12? Sorry, this script needs v13.


The columns are visible but don't show any content? The script might look in the wrong place for exiftool.exe. Turn on the script log and check:

You can force a check by turning the script off and on.


Path correct but still nothing to see? Set the logging level to max...

... and post the results.

ColumnExifTool.js:  exeExifTool:        C:\Program Files\exiftool\exiftool.exe
ColumnExifTool.js:  cacheFolder:        C:\Users\Alexander\ExifToolCache
ColumnExifTool.js:  patternCheckMode:   0
ColumnExifTool.js:  wildPattern:        *.*
ColumnExifTool.js:  wildFlags:          0
ColumnExifTool.js:  logLevel:           2
ColumnExifTool.js:  exifColumns.count:  481

Adjusting the columns to your need

The columns' standard name is a combination of the metadata group and the tag name. It's often quite long, so you can change the Opus name, label, and header to something shorter in the

exifColumns.push_back(GetColumnMap(...);

lines in the script.

You can also provide a default value, the justification, and the type. The most important is probably datetime for metadata that represents a date. Use duration where appropriate. The script has some examples built in.

How to add missing columns

Select the files whose metadata interests you and run ExifToolProbeFiles on them. The script will create one text file per selected file:

<filename>-exifColumns.txt

It contains the column definitions for all available metadata. The real values are provided as a comment for easier selection. Pick the ones you like and copy them into ColumnExifTool.js at the end of the file. Removing the comments is optional. Make sure

CheckColumns();

remains the very last line of the script.

The text file can be deleted once you copy all the necessary info.

The new columns will be available after saving the script file.

Script commands

The script provides a few supporting commands.

ColumnsToCommands

This script command modifies the clipboard content. It converts column definitions to Set commands. Just select all the exifColumns.push_back(... lines in the script you need, copy them to the clipboard, hit the button, and paste the clipboard content to the Opus toggle column button.

OpenExifToolCacheInDual

This script command opens the cache folder in the destination and selects the files that correspond with the selection in the source. Helpful for debugging, diffing, and cache cleaning.

DeleteExifToolCache

This script command deletes the cache folder for the source and refreshes the file display. Useful, if you need to force a rebuild of the cache because the script could not detect a change in the files.

Good to know

  • The metadata is cached in /profile\ExifToolCache. Feel free to change the path.
  • The script will send files to ExifTool for a refresh only if the files are younger than their corresponding cache files. If you use software that changes metadata without changing the files' modified info, you'll need to manually refresh the cache.
  • You can delete unwanted columns by deleting the entire line exifColumns.push_back(GetColumnMap(....
  • The script can help Opus rename files, but it cannot change file metadata. You need ExifTool for this job.
1 Like

This is a really useful tool - once you are familiar with the ExifTool commands.

Here is a related button, to update the PDF file-dates from the XML data;
exiftool -progress -m -P "-FileCreateDate<CreateDate" "-FileModifyDate<ModifyDate" {f}

And the inverse, to embed a new date from file-date, into XML & PDF dates within the Acrobat.PDF
exiftool -progress -m -P "-CreateDate<FileCreateDate" "-ModifyDate<FileModifyDate" *.pdf
(note we use the generic -CreateDate tag, rather than -xml:CreateDate, so both xml and pdf dates are set)
// -m Ignore minor errors and warnings
// -P Preserve file modification date/time
// -progress Show file progress count
// -delete_original Delete "_original" backups
DOpus button attached.
adjust PDF fileDates.dcf (591 Bytes)

I have the Exiftool file on my Desktop. I use Exiftool already with a couple of other applications. I have tried editing the path to exiftool.exe in the ColumnExifTool.js file and have not succeeded. No matter how I enter the path, I get an error 'Exiftool not found', and/or a message saying there is an error on line 170, position 9. I have been trying to get this to work for 3 hours.
Also, I can't figure out how to 'Generate Helper Files'.
Can somebody please help?

If you show us your edit, and the path to ExifTool on your system, we might be able to see what's wrong.

Did you double the backslashes? Opus can help with this:

Leo,
I finally got it right. I did not show it because I tried 20 or more variations. I don't know whether to include 'C:' since no Drive is listed in the original/unedited js.txt file.

Ixp tried to help, but copying the path with backslashes is still not how the path needs to be entered.
Thank you

Thank you for trying to help. However I can't insert the path as copied. I finally got it right after trying many variations.
I changed the copied path: ‘C:\Users\myusername\Desktop\exiftool.exe’
To: ‘/Users\myusername\Desktop\exiftool.exe’

I am using your ExifTool Custom Columns script. I have added an Exif DateTimeOriginal (EDTO) column to my customized Images Folder Format. If a photo does not have an EDTO, I use Exiftool to add one. However, when I return to DOPUs, no date appears in the EDTO column even If I refresh. The only way to get the newly added EDTO to appear in the column is to re-start my PC.
Can you or anyone else help me fix this?

The script uses a cache for the metadata. This cache gets rebuilt after one hour. If you change metadata and want to see the new values immediately in the columns, simply force a rebuilt by deleting the cache. The initial posting contains a button to do this.

Thank you for your help.
I have no programming experience, but I was able to get your script running after lots of trial and error.
I did not ‘Generate Helper Files’, as I have no idea what that means or how I would go about that.
I use a lot of programs that handle metadata, and changes I make are always reflected immediately. I appreciate your script, but it is disappointing to have to delete the cache for the new metadata to be shown.
Do you have any idea why the script is not detecting a change in the files?
I will try to set up the button to delete the cache.

The script could do a bit more record keeping to detect changes, but all you would get in return would be the ability to use the standard Refresh- instead of the Delete-Cache-And-Refresh-button, which you would still need to use if the metadata got changed by software that doesn't leave visible traces.

For the given mix of 3rd-party tool, ExifTool, and an Opus-script, this is as good as it gets, I think. But maybe there's a trick I am not aware of? Bring it on! I use the script every day myself, so I am very open to new ideas :slight_smile:

lxp,
Thank you for both your comment and your scripting work. I started using your script because of the problems/inconsistencies with the DOpus Date Taken field. My goal was to display the Exif DateTimeOriginal field in order to verify photo dates since I can't rely on the DOpus Date Taken field. For now, I will keep using ExiftoolGUI for this purpose.
Many applications display Exif DateTimeOriginal, so perhaps DOpus will add this field.

I am constantly refreshing DOpus, but I do not know why that is necessary. I never have to do that with other applications. If I did not have to refresh to see changes in ExifTool Custom Columns field, it would be much more appealing to me.

I'd be interested in knowing what tasks you use your script for. I've always got new ideas, but without context, I'm not sure what would be useful to you. I use a variety of different application to view, add, edit, and move photo metadata. Since I own or subscribe to so many applications for both Mac and PC, I pick the best application for whatever task I want to do. For example, if there is a need to save each file's original filename prior to batch renaming, I use Photo Mechanic to move the filename to a field such as Title (if Title is not being used) and rename and place the files into whatever folder structure I want all at the same time.

It shouldn't be needed unless something is caching data (e.g. this script, which is outside our control in general), or something is breaking change notifications (there's a FAQ on that).

Leo,
I've always had to refresh (F5) even before using this script. I need to keep careful track of all my clients' files, and so the Folder Formats I have configured always include columns for the number of files and the number of sub-folders. I frequently move files, move folders, and merge folders. The number of files, the number of folders, and the folder size does not change until I refresh.
I refresh so often I am no longer paying attention to what else refreshes (or needs to be refreshed).
By the way, the ability to set columns for the number of files and folder is one of my favourite things about DOpus.

The sub-file/folder counts aren't refreshed automatically (Windows has no good way to do that, but we're thinking of adding options to recalculate the counts more often; not sure exactly how that will work yet). Had that detail been included I would've mentioned that, but I assumed we were talking about photo metadata, given the thread.

This is really off-topic for this thread now.

Leo, it was my mistake to assume that there was some connection between the F5 refresh I do so often and the refresh needed for the ExifTool Custom Columns plugin. Sorry. Shall I delete those specific comments?

Hej there,

as I'm not really familiar in doing that by my own I would have a small ... wish... to the Pros, regarding cached things.

Is it maybe possible to let the script automatically delete the cached Information, if an exif-cache-file.txt exists, but in the desired folder the original-file not anymore?
And, the greatest thing would be... recreate the cachefile automatically, if the cache-file creation date is earlier than the filemodifydate of original file ...

And, ... I'm literally to stupid for using any duration-field from exiftool... no matter which xxxDuration-field I'm trying to place as column - always being shown is the point of time when the folder has been actualized, or after copying a file in that folder without refreshing whole list, when this copyjob has been done....

I'll keep that in mind for the next revision. The additional record keeping slows down the script significantly, unfortunately.

Not sure what you mean. Looks okay here:

Can you give examples?

The additional record keeping slows down the script significantl

I tought of investigating the relevant metadata:

mp4-file before changing:
grafik

Cachefile:

mp4-file after changing Tags with MP3tag:
grafik

I would assume, that this procedure should be quite fast.


Regarding duration, the same file:

tagged information from your helperfile is...
QuickTime MediaDuration 1:22:41

adding in exiftools.js the line ...

leads to (after adding column):

"14:38" is the time I've refreshed that folder the last time. If I'll refresh now ("14:50") Quicktime-MediaDuration changes to...

ByTheWay... as I originally have this file on a network-share, script seems not to work on network-shares ... doesn't get any tags.Is that a problem concerning exiftool.exe?