How to copy "datetaken" data?

Once again Lightroom messed up a lot of images, erasing EXIF data, & setting all images to 01.01.1601, very funny! :angry:

Luckily i have a backup of all unedited original files. Which would be the best way to extract the datetaken data from the files, so i could apply them to the messed up images? The best way would be, if the command recognizes its counterpart in the destination folder, automatically transferring the datetaken data. Any idea?

A script could do it fairly easily.

I will never learn how to script. If i had started that a twenty years ago, maybe. Meanwhile, i was really furious in the Lightroom forum. This stupid software has hundreds of unbelievable flaws, but destroying an users EXIF data, for no apparent reason, that's a crime.

By the way, i can't find a single setting in LR, which involves dates. Nevertheless, it changes all "created" dates to the time the images were edited, which is even the less harmful case. My mistake was, that was searching for that spot again, & it resulted in setting the dates to medieval times.

ExifTool's "tagsFromFile" command should solve your problem. Have a look here (9b), 2nd example from the bottom.

Here's a script to do it.

<?xml version="1.0"?>
<button backcol="none" display="both" label_pos="right" textcol="none">
	<label>Copy Date Taken</label>
	<tip>Copy Date Taken from source files to destination files with same name</tip>
	<icon1>#newcommand</icon1>
	<function type="script">
		<instruction>@script VBScript</instruction>
		<instruction>Option Explicit</instruction>
		<instruction />
		<instruction>Function OnClick(ByRef clickData)</instruction>
		<instruction />
		<instruction>	Dim f, m, d, p, src, dst, fs, cmd, i, dt</instruction>
		<instruction>	</instruction>
		<instruction>	Set src = clickData.func.sourcetab</instruction>
		<instruction>	Set dst = clickData.func.desttab</instruction>
		<instruction>	Set fs = DOpus.FSUtil</instruction>
		<instruction>	Set cmd = clickData.func.command</instruction>
		<instruction>	Set dt = DOpus.Create.Date</instruction>
		<instruction />
		<instruction>	For Each f in src.selected_files</instruction>
		<instruction>		Set m = f.metadata</instruction>
		<instruction>		if m = &quot;image&quot; Then</instruction>
		<instruction>			d = m.image.datetaken</instruction>
		<instruction>			if IsDate(d) Then</instruction>
		<instruction>				Set p = fs.NewPath</instruction>
		<instruction>				p.Set dst.path</instruction>
		<instruction>				p.Add f.name</instruction>
		<instruction>				if fs.Exists(p) Then</instruction>
		<instruction>					cmd.ClearFiles</instruction>
		<instruction>					cmd.AddFile p</instruction>
		<instruction>	</instruction>
		<instruction>					dt.Set d</instruction>
		<instruction>					cmd.RunCommand &quot;setattr meta &quot;&quot;datetaken:&quot; &amp; dt.year &amp; &quot;-&quot; &amp; dt.month &amp; &quot;-&quot; &amp; dt.day &amp; &quot; &quot; &amp; dt.hour &amp; &quot;:&quot; &amp; dt.min &amp; &quot;:&quot; &amp; dt.sec &amp; &quot;&quot;&quot;&quot;</instruction>
		<instruction>				end if</instruction>
		<instruction>			end if</instruction>
		<instruction>		end if</instruction>
		<instruction>	Next</instruction>
		<instruction>	</instruction>
		<instruction>End Function</instruction>
	</function>
</button>

The one with ""My ExifTool command doesn't work from a Windows .BAT file."?

Jon, that worked, cool. The extension looked funny, though, i had to rename it to .JPG. I will have to investigate, why that happens in LR. Anyway, the dates are restored now, & they´re very important, because of my GPS/track data to include the locations.

There was still a problem. Although the dates were successfully restored, as shown in Opus, the geo-location tool Geosetter, which uses EXIF-tools, didn't show any dates. All fields were showing up blank. Very strange. I've then tried to set the "date digitized" value in Opus, bit that also failed. I will report this separately, because it might be a bug. Eventually i had to fill in the dates manually for some 30 images, or so.