Open RAW file in ACR

Use this Forum for Beta-Testing your Photoshop Scripts

Moderators: Tom, Kukurykus

rasoetan

Open RAW file in ACR

Post by rasoetan »

Hello,

Is it possible to actually open a raw file in ACR itself? I know how to apply CR settings and how to set the options, but the file always opens in Photoshop. Can ACR be called to open a RAW file?

Thanks,
Raphael
Paul MR

Open RAW file in ACR

Post by Paul MR »

Just open it as you would any other file but do not have this line!
app.displayDialogs = DialogModes.NO;
Else it will open in Photoshop.
rasoetan

Open RAW file in ACR

Post by rasoetan »

Thanks for the reply, but app.open still bypasses ACR and goes straight to PS.
Paul MR

Open RAW file in ACR

Post by Paul MR »

You are right! Please try this...
Code: Select allvar file = File.openDialog("Please select RAW file"); 
OpenCameraRaw( file );

function OpenCameraRaw(file) {
  var keyNull = charIDToTypeID('null');
  var keyAs = charIDToTypeID('As  ');
  var adobeCameraRawID = stringIDToTypeID("Adobe Camera Raw");
  var desc = new ActionDescriptor();
  desc.putPath(keyNull, File(file.toString()));         
  var overrideOpenID = stringIDToTypeID('overrideOpen');
  desc.putBoolean(overrideOpenID, true);
  var returnDesc = executeAction(charIDToTypeID('Opn '), desc, DialogModes.ALL);
  return (returnDesc.hasKey(keyAs) && returnDesc.hasKey(keyNull));
}
rasoetan

Open RAW file in ACR

Post by rasoetan »

Once AGAIN! THANK YOU!
rasoetan

Open RAW file in ACR

Post by rasoetan »

One more thing. Is there a way to load multiple files without opening a dialog window? ScriptListener generates the same code multiple times for each file loaded but when I try to duplicate the script listener, it only loads one of them at a time. I also tried the file object array used by PS to load multiple files, that did not seem to work either. I can't believe this is as complicated as is turning out to be.

Thanks,
Raphael
Mike Hale

Open RAW file in ACR

Post by Mike Hale »

No I don't think you can open even one file in ACR without the dialog. But if you skip the File.openDialog line the normal open dialog will appear that will let you select multiple files.

Code: Select allfunction OpenCameraRaw() {
  var keyNull = charIDToTypeID('null');
  var keyAs = charIDToTypeID('As  ');
  var adobeCameraRawID = stringIDToTypeID("Adobe Camera Raw");
  var desc = new ActionDescriptor();
  var overrideOpenID = stringIDToTypeID('overrideOpen');
  desc.putBoolean(overrideOpenID, true);
  var returnDesc = executeAction(charIDToTypeID('Opn '), desc, DialogModes.ALL);
  return (returnDesc.hasKey(keyAs) && returnDesc.hasKey(keyNull));
}
rasoetan

Open RAW file in ACR

Post by rasoetan »

Thanks. Actually I was able to pass a file object to the OpenCameraRaw in your previous example without opening a dialog.

Thanks for all your input.
Raphael
carolyny476

Open RAW file in ACR

Post by carolyny476 »

It really useful for me, thanks for the info that you guys have been discussing.
ucmego

Open RAW file in ACR

Post by ucmego »

Mike Hale wrote:No I don't think you can open even one file in ACR without the dialog. But if you skip the File.openDialog line the normal open dialog will appear that will let you select multiple files.

Code: Select allfunction OpenCameraRaw() {
  var keyNull = charIDToTypeID('null');
  var keyAs = charIDToTypeID('As  ');
  var adobeCameraRawID = stringIDToTypeID("Adobe Camera Raw");
  var desc = new ActionDescriptor();
  var overrideOpenID = stringIDToTypeID('overrideOpen');
  desc.putBoolean(overrideOpenID, true);
  var returnDesc = executeAction(charIDToTypeID('Opn '), desc, DialogModes.ALL);
  return (returnDesc.hasKey(keyAs) && returnDesc.hasKey(keyNull));
}


Hi,

Is this mean't to be a .js or .jsx file.

I'm new to this and would like to use it and understand what it can do.

BTW its great to see the forum updated haven't be to this forum for a while well done.

Cheers,