Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
#target "bridge"
syncDateCommand = new MenuElement( "command", "Sync IPTC Date", "at the end of Tools",
"myAlert" );
syncDateCommand.onSelect = function () {
var sels = app.document.selections
for (i = 0; i < sels.length; i++){
var md = sels.metadata; md.namespace = "http://ns.adobe.com/exif/1.0/";
var dt = md.DateTimeDigitized;
var shortdate = dt.substr(5, 2) + "/" + dt.substr(8, 2) + " " + dt.substr(0, 4);
md.namespace = "http://ns.adobe.com/photoshop/1.0/";
md.DateCreated = shortdate;
}
}
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Reviving this old thread...
I was able to create the script provided here by pasting it in the extendscript toolkit.
But as the other user, I did not manage to get a slash between the day and year, even though I put it in place of the space in the quotes, like in the following:
#target "bridge"
syncDateCommand = new MenuElement( "command", "Sync IPTC Date", "at the end of Tools",
"myAlert" );
syncDateCommand.onSelect = function () {
var sels = app.document.selections
for (i = 0; i < sels.length; i++){
var md = sels.metadata; md.namespace = "http://ns.adobe.com/exif/1.0/";
var dt = md.DateTimeDigitized;
var shortdate = dt.substr(5, 2) + "/" + dt.substr(8, 2) + "/" + dt.substr(0, 4);
md.namespace = "http://ns.adobe.com/photoshop/1.0/";
md.DateCreated = shortdate;
}
}
What did I do wrong?
Copy link to clipboard
Copied
Please try this now...
#target "bridge"
syncDateCommand = new MenuElement( "command", "Sync IPTC Date", "at the end of Tools","myAlert" );
syncDateCommand.onSelect = function () {
var sels = app.document.selections;
for (var i in sels){
var md = sels.metadata;
md.namespace = "http://ns.adobe.com/exif/1.0/";
var dt = md.DateTimeDigitized;
var shortdate = dt.substr(0, 4) + "-" + dt.substr(5, 2) + "-" + dt.substr(8, 2);
md.namespace = "http://ns.adobe.com/photoshop/1.0/";
md.DateCreated = shortdate;
}
}
Copy link to clipboard
Copied
It is almost there, as Bridge (CS4, mac, here) seems to correct the date in European way, unfortunately I need to display it like this: (even if it is the most illogical way to display it) MM/DD/YYYY
I will try tomorrow at work on CS3, pc, to see if it matches the way it is displayed on the system.
I don't know how we can thank you enough, Paul!
You are so generous with your time and knowledge...
I think that Adobe should hire you and offer a wealth of script on the goodies folder of each application.
Copy link to clipboard
Copied
I don't think you will be able to put the date in that format, well it won't let me with any of my versions. Have you tried manualy entering a date? It should give you a HelpTip when hovering over the field stating what format it should be.
All the best and MERRY CHRISTMAS!
Copy link to clipboard
Copied
Thank you Paul, I wish you and yours a very happy holidays season!
When I enter the data manually, it does keep the order I put it in, and the four digits for the date...
If at least it can copy the date in the correct order, that's one possible mistake I can take off the metadata process.
Copy link to clipboard
Copied
Paul, I checked on a CS3 Windows with the OS being set to US date format, and your edited script works flawlessly!
Thanks again! (Yes, again, as sometimes you provide a script, and the OP does not even acknowledge it. )
Copy link to clipboard
Copied
Copy link to clipboard
Copied