ExifTool Custom Columns

Nope.

New version that allows files to either get selected or ignored based on their extensions.

How to use:

  1. Define a set of extensions specialExt.

  2. Set filterExt to determine how these extensions get handled:

    • positive value: the script will only select files with a special extension
    • zero: the script will process all files
    • negative value: the script will ignore files with a special extension

To update the previous version, simply copy the stringset (old name extToIgnore) and all lines starting with exifColumns.push_back to the new script.

ColumnExifTool.js.txt (2022-06-27b)

5 Likes

P E R F E C T

Great Job! You did it!

I would wish my external "programmers" at company would work just a little bit like You do.

Many Thanks!!

This script is very helpful to me, but not all metadata fields with dates are displaying those dates.

Because adding a Date Taken to a photo with Directory Opus results in that date being added to the Exif DateTimeOriginal field only, I made a button with a command to copy the Exif DateTimeOriginal to other date fields. When I use that button/command, I can see (using ExifToolGUI and another application) that the dates have been copied to the fields I specified, but they are not displaying in Directory Opus. I refreshed, closed and re-opened Directory Opus, and the dates are still not being displayed. I even re-started my PC just to be sure.
The fields that are not displaying a date that IS present are: Exif CreateDate and XMP CreateDate:

Dates can be seen in those fields in ExifTool GUI:

I am confident that the dates are in the metadata, so I am not too concerned that the dates aren't visible. However, I thought I should let you know.

The recent changes broke the script's ability to work in Rename commands.

This version fixes this.

ColumnExifTool.js.txt (2022-09-04)

1 Like

Changelog

  • Better performance when called from Find and Rename commands/panel
  • Files can be included/excluded in/from processing via Opus' wildcard system, instead of just by extension
  • Support for column type double which should be used for all duration type fields (don't use time)
  • Expanded logging. Worth checking if you think something's wrong/slow/stalled
  • Post-processing for some fields for improved compatibility (Quicktime, Long manufacturer model names)
  • A bit of housekeeping under the hood

ColumnExifTool.js.txt 2023-02-28

Things to do after downloading:

  • Adjust the path to exiftool.exe
  • If you have modified column definitions, you need to replace push_back(DefineColumn( with push_back(GetColumnMap( after copying them to the new version
  • If you used the specialExt feature, you need to recreate it as a wildcard. Should be easy, examples are in the script.
4 Likes

I've tried about 16 variations on the path but am still getting "no exif tool found"

Is there something missing from what I've done?

// -- Adjust to your system. Copy the path to exiftool.exe with 'Edit - Copy Other - Copy Full Pathnames (Double Backslashes)'
var exeExifTool = fsu.Resolve('C:\\exiftool\\exiftool.exe');

// -- Adjust to your preferences. Use double backslashes.
var cacheFolder = fsu.Resolve('/profile\\C:\\Users\\bri\\ExifToolCache');

Where is your exiftool.exe?

Use either

var cacheFolder = fsu.Resolve('/profile\\ExifToolCache');

or

var cacheFolder = fsu.Resolve('C:\\Users\\bri\\ExifToolCache');

Why?

I have a few, and have tried them all with double slashes

  • C:\exiftool\exiftool.exe
  • C:\Users\bri\scoop\apps\Exiftool\current\exiftool.exe
  • C:\Program Files\XnViewMP\AddOn\exiftool.exe

edit: think I figured it out; was using the buttons in the original post but it seems that they also have a line that needs updating!

edit2: it is working now. for those people that come in the future and are mystified; check that both the buttons and the ColumnExifTool.js.txt have the correct path. so in my case, my exiftool paths are above & in the js.txt I've made it:

// -- Adjust to your system. Copy the path to exiftool.exe with 'Edit - Copy Other - Copy Full Pathnames (Double Backslashes)'
var exeExifTool = fsu.Resolve('C:\\exiftool\\exiftool.exe');

// -- Adjust to your preferences. Use double backslashes.
var cacheFolder = fsu.Resolve('/profile\\ExifToolCache');

thanks! I'm not sure if it was different, but i changed it to var cacheFolder = fsu.Resolve('/profile\\ExifToolCache'); ; still fails bc of missing exiftool.

edit: ahh, I see the issue maybe; I was using your buttons above "Generate Exiftool Helper Files" so I could try to see what I was doing wrong, but I see that the buttons also have a var exeExifTool = fsu.Resolve('/bin\\exiftool\\exiftool.exe'); which I'd guess has to be resolved as well

Yes.

A good opportunity to update the helper button to reflect the new syntax. See the next post.

Update of the helper button Generate Helper Files. You will probably need to adjust the path to exiftool.exe (2023-03-14).

Button as XML
<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
	<label>Generate Helper Files</label>
	<tip>Generates .txt helper files for selected files</tip>
	<icon1>#newcommand</icon1>
	<function type="script">
		<instruction>@script JScript</instruction>
		<instruction>// 2023-03-14</instruction>
		<instruction />
		<instruction>function OnClick(clickData) {</instruction>
		<instruction>    var cmd = clickData.func.command;</instruction>
		<instruction>    var tab = clickData.func.sourcetab;</instruction>
		<instruction>    var dlg = clickData.func.Dlg();</instruction>
		<instruction>    var wsh = new ActiveXObject(&apos;WScript.Shell&apos;);</instruction>
		<instruction>    var fso = new ActiveXObject(&apos;Scripting.FileSystemObject&apos;);</instruction>
		<instruction>    var fsu = DOpus.FSUtil();</instruction>
		<instruction>    var exeExifTool = fsu.Resolve(&apos;/bin\\exiftool\\exiftool.exe&apos;);</instruction>
		<instruction />
		<instruction>    cmd.deselect = false;</instruction>
		<instruction />
		<instruction>    if (!fsu.Exists(exeExifTool)) {</instruction>
		<instruction>        dlg.Request(&apos;exiftool.exe not found!&apos;, &apos;OK&apos;);</instruction>
		<instruction>        return;</instruction>
		<instruction>    }</instruction>
		<instruction />
		<instruction>    cmd.RunCommand(&apos;Set UTILITY=otherlog&apos;);</instruction>
		<instruction>    DOpus.ClearOutput();</instruction>
		<instruction>    DOpus.Output(&apos;Enumerating...\n&apos;);</instruction>
		<instruction />
		<instruction>    for (var e = new Enumerator(tab.selected_files); !e.atEnd(); e.moveNext()) {</instruction>
		<instruction>        var item = e.item();</instruction>
		<instruction>        DOpus.Output(item);</instruction>
		<instruction />
		<instruction>        var fileTags = fsu.GetItem(item + &apos;-Tags.txt&apos;);</instruction>
		<instruction />
		<instruction>        var cmdLine = &apos;&quot;&apos; + exeExifTool + &apos;&quot; -short -duplicates -unknown -groupNames -tab -textOut! &quot;%0f&apos; + fileTags + &apos;&quot; &quot;&apos; + item + &apos;&quot;&apos;;</instruction>
		<instruction>        wsh.Run(cmdLine, 0, true);</instruction>
		<instruction />
		<instruction>        var tfColDefs = fso.CreateTextFile(item + &apos;-ColDefs.txt&apos;);</instruction>
		<instruction>        var tfColCmds = fso.CreateTextFile(item + &apos;-ColCmds.txt&apos;);</instruction>
		<instruction />
		<instruction>        var tf = fso.OpenTextFile(fileTags, 1);</instruction>
		<instruction>        while (!tf.AtEndOfStream) {</instruction>
		<instruction>            var line = tf.ReadLine().split(&apos;\t&apos;);</instruction>
		<instruction>            var group = line[0];</instruction>
		<instruction>            var tag = line[1];</instruction>
		<instruction>            var value = line[2];</instruction>
		<instruction>            var str = &apos;exifColumns.push_back(GetColumnMap(\&apos;&apos; + group + &apos;\&apos;, \&apos;&apos; + tag + &apos;\&apos;, \&apos;\&apos;, \&apos;\&apos;, \&apos;\&apos;, \&apos;\&apos;, \&apos;\&apos;, \&apos;\&apos;));&apos;;</instruction>
		<instruction>            while (str.length &lt; 140) str += &apos; &apos;;</instruction>
		<instruction>            str += &apos;// &apos; + value;</instruction>
		<instruction>            tfColDefs.WriteLine(str);</instruction>
		<instruction>            tfColCmds.WriteLine(&apos;Set COLUMNSTOGGLE=&quot;scp:ExifTool/&apos; + group + &apos;-&apos; + tag + &apos;(!,a,0)&quot;&apos;);</instruction>
		<instruction>        }</instruction>
		<instruction>        tf.Close();</instruction>
		<instruction />
		<instruction>        tfColDefs.Close();</instruction>
		<instruction>        tfColCmds.Close();</instruction>
		<instruction>    }</instruction>
		<instruction>    DOpus.Output(&apos;\n... done&apos;);</instruction>
		<instruction>}</instruction>
	</function>
</button>
2 Likes

I worked several hours learning to use this script today.
I'm still on the original version you posted, but I'll get it up to date soon.
I would have done this much sooner had I known what I know now.
One thing I would want to change is to have the Field of View displayed in radians rather than degrees and as a fraction of pi with a fixed reducible denominator.
Well, I need start learning Jscript.
Thanks very much !

I'll get it up to date soon.

Yes, you should, because...

I would want to change is to have the Field of View displayed in radians rather than degrees and as a fraction of pi with a fixed reducible denominator.

... the current version from February lets you easily do this, starting line 382.

If you get stuck, just whistle :slight_smile:

I love ExifTool Custom Columns, but I still don't know what 'Helper Files' are. Please explain.

There's not much to them. At which point did you get stuck?

Here, it just prints "Enumerating ..." writes the -Tags file and ... nothing more.
Also, I don't have the possibility to select some exif-made columns, unless I am missing something.


Thanks for your effort, btw. :+1:

Seriously cool, @lxp. Great work and well documented. Thanks so much!

Update 2024-01-11

  • Ready for Opus v13
  • Easier to install and configure. Just save two files to your config.
  • All buttons converted to commands
  • Ready-to-run Toolbar
  • Faster
  • More predefined columns

How to update an existing installation

:one: If you have column definitions you want to keep, replace

push_back(DefineColumn(

with

push_back(GetColumnMap(

then copy the lines to the new script.

:two: Remove the old script from the /scripts folder.

:three: All old script buttons have been replaced with commands and can be removed.

:four: Everything else should work as before.

4 Likes