Skip to main content
Participant
December 16, 2016
Answered

Add Original File Date

  • December 16, 2016
  • 2 replies
  • 2531 views

I have a bunch of files which have no Date Stamps anywhere in the metadata. The file system holds the Date Created and Date File Modified and I want to move those dates to IPTC fields. How do I script the pulling of dates from the file system and placing them into IPTC?

This topic has been closed for replies.
Correct answer SuperMerlin

You could try this script on the selected files.

#target bridge 

   if( BridgeTalk.appName == "bridge" ) { 

addDates = MenuElement.create("command", "Add Dates", "at the end of tools");

}

addDates.onSelect = function () {

if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");

var thumbs= app.document.selections;

for(var z in thumbs){

var md = thumbs.synchronousMetadata;

md.namespace = "http://ns.adobe.com/exif/1.0/";

var newDate = md.DateTimeOriginal ? new XMPDateTime(md.DateTimeOriginal.toString()).getDate().getTime() : thumbs.spec.created.getTime();

md.DateTimeOriginal ='';

md.DateTimeOriginal = new XMPDateTime(new Date(newDate));

md.namespace = "http://ns.adobe.com/photoshop/1.0/";

md.DateCreated = '';

md.DateCreated = new XMPDateTime(new Date(newDate));

md.namespace = "http://ns.adobe.com/xap/1.0/";

md.CreateDate='';

md.CreateDate = new XMPDateTime(new Date(newDate));

md.ModifyDate='';

md.ModifyDate = new XMPDateTime(new Date(newDate));

md.MetadataDate='';

md.MetadataDate= new XMPDateTime(new Date(newDate));

}

alert("All done")

};

2 replies

Varun Varshney
Adobe Employee
Adobe Employee
October 15, 2018

Hi All,

We have released a new version of Adobe Bridge (CC 2019) on 15th October 2018. The new version build number is 9.0.0.204. This version is available to install via Adobe Creative Cloud application.

This Bridge update contains support for editing capture time of images (https://helpx.adobe.com/bridge/using/preview-compare-images-bridge.html#Edittheimagecapturetime).

Please check following link to know about all new features in Adobe Bridge CC 2019 - https://helpx.adobe.com/bridge/using/whats-new.html

You may need to update the Creative Cloud application and restart your computer to see the updated installer.

Thanks,

Varun Varshney

SuperMerlin
Inspiring
December 16, 2016

It depends on the file type if you can do what you are asking.

As a start you could try this script..

https://www.ps-scripts.com/viewtopic.php?f=72&t=24357

This lets you change the create date, where you could try altering it by one second with set all dates same as createdate checkbox ticked.

Once again it will depend on the file types you are are trying to amend!

tthorstedAuthor
Participant
December 16, 2016

All my files are regular TIFF images. I have been using the filename to IPTC script found here and it works great. I am looking for something as simple to take the file's create date and populate the IPTC or EXIF Date fields. According to the Script reference I can use the Thumbnail Object to pull a creationDate or modifedDate similar to pulling a name from the thumbnail object.

SuperMerlin
SuperMerlinCorrect answer
Inspiring
December 16, 2016

You could try this script on the selected files.

#target bridge 

   if( BridgeTalk.appName == "bridge" ) { 

addDates = MenuElement.create("command", "Add Dates", "at the end of tools");

}

addDates.onSelect = function () {

if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript");

var thumbs= app.document.selections;

for(var z in thumbs){

var md = thumbs.synchronousMetadata;

md.namespace = "http://ns.adobe.com/exif/1.0/";

var newDate = md.DateTimeOriginal ? new XMPDateTime(md.DateTimeOriginal.toString()).getDate().getTime() : thumbs.spec.created.getTime();

md.DateTimeOriginal ='';

md.DateTimeOriginal = new XMPDateTime(new Date(newDate));

md.namespace = "http://ns.adobe.com/photoshop/1.0/";

md.DateCreated = '';

md.DateCreated = new XMPDateTime(new Date(newDate));

md.namespace = "http://ns.adobe.com/xap/1.0/";

md.CreateDate='';

md.CreateDate = new XMPDateTime(new Date(newDate));

md.ModifyDate='';

md.ModifyDate = new XMPDateTime(new Date(newDate));

md.MetadataDate='';

md.MetadataDate= new XMPDateTime(new Date(newDate));

}

alert("All done")

};