Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Save a copy to specific folder and edit original

Explorer ,
Sep 28, 2016 Sep 28, 2016

Is it possible in Bridge to make a script that:

  1. Copy a photo from original folder to a specific other folder
  2. Give the original photo a keyword, label or a metadata field with the date of today?

I've been using PHP and VBA, and have just started learning JavaScript, so I might manage to figure out something of my own if you point me in the right direction. If you could give me the script ready to use I'll be very grateful.

Our situation:

We are publishing photos in a weekly news paper and online. We have photos in one folder, ready to use. When we put a photo in production we copy it to another folder, but we would like to know if and when a photo has been used, so we're not using the same photo over and over again. It would be very nice If we can mark the original somehow with "used" and "date".

Thank you!

Using Bridge CC 6.3.1.186 x64

TOPICS
Scripting
693
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Sep 29, 2016 Sep 29, 2016

Here is an example of adding "Used" and the date to the title field also copying the file to a selected folder.

#target bridge 

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

copyAndDate = MenuElement.create("command", "Copy and Date files", "at the end of Tools");

}

copyAndDate.onSelect = function () {

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

var copyFolder = Folder.selectDialog("Please select folder to copy files to...",F

...
Translate
Guide ,
Sep 29, 2016 Sep 29, 2016

Here is an example of adding "Used" and the date to the title field also copying the file to a selected folder.

#target bridge 

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

copyAndDate = MenuElement.create("command", "Copy and Date files", "at the end of Tools");

}

copyAndDate.onSelect = function () {

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

var copyFolder = Folder.selectDialog("Please select folder to copy files to...",Folder(app.document.presentationPath));

var sels = app.document.selections;

for(var a in sels){

var thumb = sels;

thumb.copyTo(copyFolder);

var md = thumb.synchronousMetadata;

md.namespace =  "http://purl.org/dc/elements/1.1/";

md.title = '';

md.title = "Used " +  new XMPDateTime(new Date());

    }

};

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 02, 2016 Oct 02, 2016

Thank you, this was just what I needed, you made my day!

Just one question: If I just want the date and not time, how do I do that? Is it possible to show XMPDateTime as YYYY-MM-DD or DD-MM-YY?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Oct 02, 2016 Oct 02, 2016
LATEST

Just change:-

md.title = "Used " +  new XMPDateTime(new Date()); 

To:

md.title = "Used " +  new XMPDateTime(new Date()).toString().match(/.{10}/);

This will just use the first 10 characters.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines