Using ExifTool Commands with Directory Opus

I use ExifTool GUI ( ExifToolGUI) , but I have never used ExifTool via command line. In ExifTool GUI, I do use some commands.

In this topic: Metadata not showing for HEIC/HEVC - #6 by aussieboykie there are Exiftool commands, but even after researching for the last couple of hours, I don't understand how those commands are supposed to be used in Directory Opus. Or are they not meant to be used with Directory Opus but only with ExifTool?

I have ExifTool installed, and I am using the ExifTool Custom Columns columns script for Directory Opus.

I want to copy the Exif DateTimeOriginal to the Exif CreateDate of files selected in DOpus.
I created a button with the same command I use in ExifTool GUI: - Exif:CreateDate<Exif:DateTimeOriginal .
If I click that button, an ExifTool Command Line window opens, and then I don't know what to do. Everything I read (in this website and at exiftool.org) seems to assume I know more than I do, so I feel like I'm always a step or 2 behind.

I tried selecting the files in DOpus then clicking the button I made, and entering - Exif:CreateDate<Exif:DateTimeOriginal (as I would in ExifToolGUI). Nothing.

I tried selecting the files in DOpus then clicking the button I made, and entering exiftool.exe - Exif:CreateDate<Exif:DateTimeOriginal (because I see "exiftool.exe" used before the command in the topic listed above) . Nothing.

I tried clicking the button I made, dragging the folder from DOpus into the command line window that opened, and entering both variations on the command listed above. Nothing.

Perhaps someone could help me or at least point me in the right direction? Thank you.

I did some more research today, and I think that when one runs an ExifTool command IN Dopus (as a button, for example) , one must include the path to Exiftool as it is on one's computer, like "C:\Windows\exiftool.exe..."
BUT if one uses ExifTool independently of DOpus, one starts the command with "exiftool.exe ..."
Is that correct?

It depends if ExifTool’s folder is in the Windows command path (or if you’re in the folder it is in, when running it from a command prompt directly).

This isn’t specific to Opus. It’s how Windows works in general. If you don’t need the full path in one place then you probably don’t need it in the other.

(It shouldn’t be put in the C:\Windows folder, though. Only things that are part of Windows belong in there. Program Files is the usual place to install software.)

Exiftool is on my desktop. I copied that path from another post in this forum. I have been using ExifTool for a couple of years, but I use ExifToolGUI as as opposed to using command line.
Some topics in this forum mention running ExifTool, and others mention creating a button for the ExifTool command, so I am still unsure what to do.

Just use the commands from the posts, and adjust them to point to wherever ExifTool.exe is on your computer if it isn't in the same place the point to already.

I got this to work: exiftool.exe -overwrite_original -all= -@ {allfilepath|filem} from this topic: Clear All Metadata for All Files Ignoring Errors - #9 by Leo

But I can't get this to work: exiftool.exe -Exif:CreateDate<Exif:DateTimeOriginal (that's a command I use in ExifTool GUI)
So, I tried adding -@ {allfilepath|filem} and that worked except that a copy of each file was created with a date in the Exif Created Date field, but I don't want those copies to be made.

Since these are supposedly ExifTool commands run by DOpus, I don't understand where this comes from -@ {allfilepath|filem} since I can't find anything about that in ExifTool documentation.

So, if running ExifTool commands in Dopus requires adding non ExifTool code, how do I know what code (or even type of code) to use?

None of the ExifTool commands I want to run are mentioned in this forum.

ExifTool comes with a huge documentation.

You can capture it with

exiftool.exe > ExifToolHelp.txt

You will benefit greatly from reading the first 150 lines.

From the ExifTool documentation:

From the Opus documentation:

https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Codes_for_passing_filenames.htm

The windows command line gets confused by certain characters, so some parameters need to be put in quotes.

Putting it all together:

@nodeselect

exiftool.exe -overwrite_original "-Exif:CreateDate<Exif:DateTimeOriginal" -@ {allfilepath|filem} 

pause
Button as XML
<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>41677</label>
	<icon1>exiftool.exe,0</icon1>
	<function type="batch">
		<instruction>@nodeselect</instruction>
		<instruction />
		<instruction>exiftool.exe -overwrite_original &quot;-Exif:CreateDate&lt;Exif:DateTimeOriginal&quot; -@ {allfilepath|filem} </instruction>
		<instruction />
		<instruction>pause</instruction>
	</function>
</button>

150 lines????

Teenager with ADD????

I opened the documentation and it's about 25 lines. Then I see the word 'more' but can't get more. Did you mean first 15 lines?

UPDATE:
By trying different keys, I discovered that the space bar is what I need to click to reveal 'more'.
I still don't know what I need to learn to be able to better understand the use of code/scripts in DOpus. What should I learn? DOS?
Thanks to lxp, I have finally learned that ExifTool commands need to be combined with "Codes for passing filenames". Could someone please add that information to the article “How to use buttons and scripts from this forum“.

DOpus documentation seems to assume users have a certain type and level of knowledge. I am an expert photo organizer and I have expert-level knowledge of photo metadata, but I have never done any programming or learned any code other than HTML.

Please tell me what should I learn about to be able to figure these things out myself.

There are almost as many lines in this thread already. :slight_smile: Sometimes the long way is the shortest path.

When a command-line tool shows a "more" prompt, it's usually waiting for you to push the space bar to show the next screen of text.

But you can also make it output everything into a text file for easier reading, using the command in Lxp's post above ("You can capture it with...").

1 Like

Leo,
First, I updated my previous post. I figured out that I needed to use the space bar.
Second, I have not yet figured out how to generate that text file because I don't even know where to enter it! I opened ExifTool, but the documentation is there. I opened Command prompt, entered that command, and nothing happens!

UPDATE: I found the text file because I'm pretty good at figuring things out (eventually) BUT what do I need to research? Where would I learn, for example, that it's the space bar one needs to click to see "more".
The help I am getting assumes I know certain things - like WHERE to enter the command to generate the help file - but I don't know those things.

NO! Just someone trying very hard to figure this out! I though that was a typo because I didn't know how to get "more".

Leo,
According to the installation instruction at on the ExifTool website, the file can be placed in C:\Windows. ExifTool is not 'installed'. It should NOT be placed in the Program Files folder.
Since I am having so much difficulty figuring this out, I felt the need to correct you so that others who might read this in the future get the correct information.

When I use the code that you posted above, the Exif DateTimeOriginal does get copied to the Exif CreateDate field, but then I get this error message:

Can anyone help me fix this error?

Something strange is happening. I have a folder of test files I am using for testing this. I can only explain by writing it step-by-step:

  1. Folder A Test files have no Exif date metadata.
  2. I made a copy of A Test and named it B Test.
  3. I opened B Test folder and tested the command. The Exif DateTimeOriginal was successfully copied to the ExifCreateDate field.
  4. I deleted folder B Test.
  5. I copied folder A Test (again), then renamed it B Test.
  6. I opened B Test folder, and the files had the date metadata added to the old B Test folder I deleted.
  7. If I rename the folder with another letter, that does not happen.

So, it seems DOpus or Exiftool is 'remembering' the folder name and adding Exif dates to those files.
Now I am investigating other code I see such as -@ {allfilepath|filem} to find out if perhaps that has something to do with the problem.

Yes, I could just give the file a different name, but I am uncomfortable with mysterious things happening when I don't know why.

Could someone please suggest how to stop Exif Dates being added to the folder I copy and rename?

In the Command Editor for the button, set the Function drop-down to MS-DOS Batch Function.

Thank you.
Now I don't get the 'pause' error, but the command window opens:
image
Is that normal/expected?

That 'strange thing' still happens though.

Despite all the forum posts and pages I have read, I had no idea I was supposed to set the Function to MS-DOS. At one point (not in this topic) It was suggested I follow the instruction for using Raw Commands in 'How to use Buttons and Scripts from this Forum', but there is no mention of Function or MS-DOS there. I have seem info about MS-DOS commands, but I had no idea this was an MS-DOS Command.

Were you checking with the ExifTool Custom Columns? Then yes, the script wasn't aware of the folder name change and read from the wrong cache files. Simply delete the cache and try again.

And no, -@ {allfilepath|filem} has nothing to do with it.

Yes. ExifTool provides valuable feedback about what it has done with your files or found out about them.

The xml-button I posted is oven-ready with the function set to MS-DOS. It even contains a cute little icon :slight_smile:

1 Like

Thank you. I didn't use the xml button. My point is that I have seen nothing to indicate that MS-DOS should be used - other than Leo telling me that.

Simply? I can't find info about deleting the cache in this Forum or the online manual. I looked for a cache folder where the program is installed and in Program Data. I did not see one. In App Data >Local, there are 4 Directory Opus folders:
image
I don't think any of these folders are what I need to delete.

Please tell me where is the cache and how to delete it.