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

An old script for copying labels not working

Explorer ,
Jan 09, 2025 Jan 09, 2025

Copy link to clipboard

Copied

On a previous PC i made a script to copy labels and ratings from jpg to raw. I made it because I save both raw and jpg when photographing and when I look through Bridge load the jpg faster. So my workflow:

  1. Rate, label, delete jpg
  2. Copy rating etc to raw
  3. Edit the raw-files with high rating

 

But nothing happens when I run this script (except the deselect all, that works). May you tell me why?

 

#target bridge   

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

labelRate = MenuElement.create("command", "Label Rate from JPGs", "at the end of Tools","labelRate");

}

labelRate.onSelect = function () { 

	app.document.deselectAll();
	
	var sels =app.document.getSelection("jpg");

	for(var a in sels){

		var sourceFile = File(sels.spec);

		var destFile = File(sourceFile.toString().replace(/jpg$/i,"arw"));

		if(!destFile.exists) continue;

		var thumb = new Thumbnail(destFile);

		thumb.rating = sels.rating;

		thumb.label = sels.label;

    }

};

 

TOPICS
Batch , How to , Scripting

Views

47

Translate

Translate

Report

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
Community Expert ,
Jan 09, 2025 Jan 09, 2025

Copy link to clipboard

Copied

@IngyNorw – Forgive the “obvious" question, however, are you still using .arw files?

Votes

Translate

Translate

Report

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
Community Expert ,
Jan 09, 2025 Jan 09, 2025

Copy link to clipboard

Copied

LATEST

There were some minor errors in the code, this corrected version should now work:

/*
https://community.adobe.com/t5/bridge-discussions/an-old-script-for-copying-labels-not-working/td-p/15079694
*/

#target bridge

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

    var labelRate = MenuElement.create("command", "Label Rate from JPGs", "at the end of Tools", "labelRate");

}

labelRate.onSelect = function () {

    app.document.deselectAll();

    var sels = app.document.getSelection("jpg");

    for (var a in sels) {

        var sourceFile = File(sels[a].spec);

        var destFile = File(sourceFile.toString().replace(/jpg$/i, "arw"));

        if (!destFile.exists) continue;

        var thumb = new Thumbnail(destFile);

        thumb.rating = sels[a].rating;

        thumb.label = sels[a].label;

    }

};

Votes

Translate

Translate

Report

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