Open RAW file in ACR

Use this Forum for Beta-Testing your Photoshop Scripts

Moderators: xbytor, DavideBarranca, Paul MR

rasoetan

Open RAW file in ACR

Post by rasoetan » Fri Mar 19, 2010 7:37 pm

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 » Fri Mar 19, 2010 8:14 pm

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 » Fri Mar 19, 2010 9:07 pm

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 » Fri Mar 19, 2010 10:14 pm

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 » Fri Mar 19, 2010 10:26 pm

Once AGAIN! THANK YOU!

rasoetan

Open RAW file in ACR

Post by rasoetan » Sat Mar 20, 2010 3:51 am

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 » Sat Mar 20, 2010 4:55 am

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 » Sat Mar 20, 2010 5:20 am

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 » Fri Sep 10, 2010 4:17 am

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

ucmego

Open RAW file in ACR

Post by ucmego » Mon Sep 27, 2010 9:39 am

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,

Post Reply