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

Tricky problem. Opening RAW with Javascript. White balance problem.

Explorer ,
Mar 04, 2012 Mar 04, 2012

Hi all. Hopefully someone can help with this - its a tricky one.

I've been using a javascript to send RAW and DNG files to Photoshop CS5 for automatic processing. The script opens the files directly into PS, apparently bypassing Adobe Camera Raw. It always renders the photos with the ACR default settings which can be set in either ACR on Lightroom. The standard Adobe settings are WB (As Shot), Brightness (+50), Contrast (+25).

My problem is that it ignores any changes I have made to the RAW files in ACR. So if I want to use a custom white balance, its not possible to use the javascript. The script ignores the 'custom' white balance and resets it to 'As Shot'.

I've tried changing the default values in ACR but the options are As Shot, or a set Kelvin preset such as Tungsten, Sunlight etc. Nothing helps.

Is it possible for the script to be mindful of the custom adjustments - especially subtle changes to WB - that I have made in ACR?

The script is below...

var stacks = app.document.stacks;
var stackCount = stacks.length;
for(var s = 0;s<stackCount;s++){
      var stackFiles = getStackFiles( stacks );
      if(stackFiles.length> 1){
           var bt = new BridgeTalk;
           bt.target = "photoshop";
           var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+stackFiles.toSource()+");");
           bt.body = myScript;
           bt.onResult = function( inBT ) {myReturnValue(inBT.body); }
           bt.send(500);
      }
}
function getStackFiles( stack ){
      var files = new Array();
      for( var f = 0; f<stack.thumbnails.length;f++){
           files.push(stack.thumbnails.spec);
      }
      return files;
};
function myReturnValue(str){
      res = str;
}
function psRemote(stackFiles){
      var loadLayersFromScript = true;
      var strPresets = localize ("$$$/ApplicationPresetsFolder/Presets=Presets");
      var strScripts = localize ("$$$/PSBI/Automate/ImageProcessor/Photoshop/Scripts=Scripts");
      var strFile2Stack = "Load Files into Stack.jsx";
      var ipFilePath = app.path + "/" + strPresets + "/" + strScripts + "/" + strFile2Stack;
      var ipFile = new File (ipFilePath);
      $.evalFile( ipFile );
      loadLayers.intoStack(stackFiles);
      app.doAction ('My Action');
      var saveFile = new File('~/desktop/'+(new Date().getTime().toString())+'.psd');
      app.activeDocument.saveAs(saveFile);
      app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}

TOPICS
Scripting
2.6K
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
Guru ,
Mar 04, 2012 Mar 04, 2012

But isn't this script just passing a list of files from Bridge to anther script in Photoshop? My guess would be that you need to look at the file opening options in the 'Load Files into Stack.jsx'

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
Valorous Hero ,
Mar 04, 2012 Mar 04, 2012

You also need to correct your action, it requires two parameters...

app.doAction("ActionName","ActionSet");

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 ,
Mar 04, 2012 Mar 04, 2012

Thanks for your help. This post should really be in the Photoshop Scripting forum because it regards Load Files into Stacks.jsx. I've moved it to http://forums.adobe.com/thread/970758

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
Valorous Hero ,
Mar 05, 2012 Mar 05, 2012

You could stack your own files IE:...

var stacks = app.document.stacks;
var stackCount = stacks.length;
for(var s = 0;s<stackCount;s++){
      var stackFiles = getStackFiles( stacks );
      if(stackFiles.length> 1){
           var bt = new BridgeTalk;
           bt.target = "photoshop";
           var myScript = ("var ftn = " + psRemote.toSource() + "; ftn("+stackFiles.toSource()+");");
           bt.body = myScript;
           bt.send(5);
      }
}
function getStackFiles( stack ){
      var files = new Array();
      for( var f = 0; f<stack.thumbnails.length;f++){
           files.push(stack.thumbnails.spec);
      }
      return files;
};

function psRemote(stackFiles){
app.bringToFront();
var thisDoc = open(File(stackFiles[0]));
var Name = decodeURI(app.activeDocument.name).slice(0,-4);
thisDoc.layers[0].name = decodeURI(Name);
for(var a = 1;a<stackFiles.length;a++){
    open(File(stackFiles));
    Name = decodeURI(app.activeDocument.name).slice(0,-4);
    activeDocument.activeLayer.duplicat...







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 09, 2013 Oct 09, 2013
LATEST

Paul,

this script do perfectly what i need... But unfortunately not in Bridge CS6 😞

I use Windows7 64 and CS6. When I run the script from the Extended Script Toolkit, everything works great.

Then I saved the script in the Bridge folder "startup scripts". At the start of Bridge I get the following error message:

"Error in C: \ Users \ ... \ AppData \ Roaming \ Adobe \ Bridge CS6 \ Startup
Scripts \ Stack Batch.jsx
Line 1: var = app.document.stacks stacks;
undefined is not an object "

Bridge and then starts the script is not enabled.

Thanks for any help
-kai

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