ExifTool by Phil Harvey is great work for powerfull reading, editing and changing metadata to get use om them.
I slowly get warm with playing around on Windows 7 to find out how it works for me, and more, to get it working in DOpus buttons.
Several buttons exist, but not yet for public because they are unstable in use and not very well documented. Maybe later...
exiftool -d %Y%m%d_%H%M%S_%%f.%%e "-FileName<CreateDate" DIR
This code changes the filename from meta createdate and adds the old name working on all meta-files found in dir.
You will get f.e. "20080505_110614_P5050487.jpg" or "20080505_110614_P5050487.orf" supporting all kinds of rawfiles and a bunch of formats somebody is using.
The main I will get use of ExifTool is working on my RAW and TIFF till I get raw-reading in DOpus as well. But my need is now...
This is a command working fine for me from commandline and is being checked by ExifTool-development, Phil Harvey.
He said it's fine too, but he has no idea what is going wrong that the command from DOpus-button runs into problems.
The set format is changed in the commandbatch. %d is changed with the {sourcepath$}. {sourcepath$} works well with similar DIR-commands.
While the %d is set by DIR "%Y%mDIR" is taken to set the path for output and the command runs in error because it doesn't exist.
The verbose-output of this from CMD-window...
My DOpus-botton for testing. But take care for your originals. A false written command may mix up your meta.
<?xml version="1.0"?>
<button backcol="none" display="both" icon_size="large" textcol="none">
<label>-FileName<CreateDate&oldname.exp </label>
<icon1>C:\Windows\exiftool.exe,0</icon1>
<function type="normal">
<instruction>exiftool -d %Y%m%d_%H%M%S_%%f.%%e "-FileName<DateTimeOriginal" {sourcepath$} -v -k </instruction>
</function>
</button>
Need is a windows exiftool.exe, renamed for a clean installation in your Windows-folder (or a Perl-installation for the Perlscript, which works also on Amiga).
The -k in the released executive causes pause to the CMD-output...
Will you please have a look to the screenshots and give a hint what's to change for working in DOpus. Phil gave the hint that percents in commandline are doubled... But I tried this, also tripled without any success.
Set the function type to MS-DOS Batch, put "echo " before the line, and add a line after it with "pause" on it.
Run that and you'll see what Opus is passing to the other program and can compare it against what you're running by hand. (Note that % characters have special meaning in DOS batch files so you might need to double them up after you switch. Not sure.)
It could be that the {sourcepath} is being quoted (which will happen if it has a space in it), although I'd be surprised if ExifTool is unable to deal with that.
Oh, I just had a closer look at your command and it's using <CreateDate to read input from a file on the command-line. You'll definitely need to use the MS-DOS Batch function type, since that is a feature of DOS and not something that works in other contexts. That might be enough to make it work by itself.
Sorry.
DOS-Mode runs into the exiftool HLP. I tried before.
To double % doubles %% the shown parts of the formatted DateTime.
-k=pause on ExifTool, -v_erbose=echo
The CreateDate is the Exiftag. 'FileName<CreateDate' takes the filename and changes it by the read exiftag. It's right that the file is read.
Doublequotes on {sourcepath$|noterm} does but the same error.
It seems to me being a bug in DOpus. \d in DOS takes the filepath. The cut in DateTime-definiton is made on %d where the DIR/sourcepath is inserted.
This isn't quite the same command you were trying to run, but it does work on my system (I use ExifTool too). Note it does not process all files in a directory, I made it so it processes only selected files.
Perhaps this will help you solve your problem. Make sure you have the Opus button type set to MS-DOS Batch Function. Also make sure each line in the button code is clear to the left and not indented.
Have you tried putting echo and pause into the command to see what is being run and compare it with what you are running by hand, as I suggested?
There has to be a difference between the two since, with the button set to DOS Batch mode, they are being run by exactly the same thing (the command prompt).
The created Button (with exiftool.exe in C:\Windows) changed to take all (META)files from the active source-lister.
Note: "-k -v" is added to get control on the CMD-window. You can remove to get quiet working.
<?xml version="1.0"?>
<button backcol="none" display="both" textcol="none">
<label>Rename ALL by META</label>
<tip>Rename all files in DIR by META CreateDate </tip>
<icon1>C:\Windows\exiftool.exe,0</icon1>
<function type="batch">
<instruction>@nofilenamequoting</instruction>
<instruction>exiftool -d "%%Y%%m%%d_%%H%%M%%S_%%%%f.%%%%e" "-FileName<CreateDate" {sourcepath$} -k -v</instruction>
</function>
</button>
Finally to say: DOS-Mode! All original percents are doubled!
It was a rich experiance to me.
I say a big thankyou for helping and it's no bug in DOpus. You were right, Leo!
Puhh, it's done after 4 days work.
Bye, Eike
All I did was to double up the percentages and change the DIRectory to selected files as I always prefer to work with selected (files although using a directory would be faster).
Well done. I was an idiot playing around with percents in several ways instead of consistant doubling.
I see kundal uses the perl-edition with need for a Perl-installation and working standard handling for the extension.
Because it has a risc with false clicks I put in the modificator @filesfromdroponly . To Drag&Drop has more savety.