Copy link to clipboard
Copied
If user opens RAW-file in Photoshop from Bridge with Shift-holding.. We have strange document that have one layer. I checks type of this layer by script and I gets that it is smart-object. But this is strange smart-object. Then I open it I don't get simple new document but I get Adobe Camera Raw window with this document. Script Listener don't write anything then I change it's ACR parameters. So my questions:
- Can I determine type of this smart-object by script? (usual or with ACR-parameters)
- Can I change its ACR-parameters by script?
Thank you
var smartObject_FileReference = desc.getObjectValue(stringIDToTypeID('smartObject')).getString(stringIDToTypeID('fileReference'))
I assume that in "desc" variable would be whole layer descriptor.
Copy link to clipboard
Copied
That is normal behavior. When you open a file from within Camera Raw as an object, it will reopen ACR when double clicked. A lot of people want to be able to reedit the image in ACR, and use this method. If you want to do it the way you suggested, open the file normally, then convert it to a smart object.
I don't think there is a way to determine how the SO was created with a script, though.
Copy link to clipboard
Copied
ad 1)
layer descriptor > smartObject > fileReference: "myfile.ext"
You can have list of all Raw file extensions and check if filereference has this extension.
Copy link to clipboard
Copied
Can you show code for this?
Also I need to know more: Is this layer with simple Raw-file or with Raw-file with ACR-parameters that was opened as object
Copy link to clipboard
Copied
var smartObject_FileReference = desc.getObjectValue(stringIDToTypeID('smartObject')).getString(stringIDToTypeID('fileReference'))
I assume that in "desc" variable would be whole layer descriptor.
Copy link to clipboard
Copied
Thank you. I resolved this task.
So I got result code:
function getSmartObjectFileSource()
{
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
var desc = executeActionGet(ref);
if(desc.hasKey(stringIDToTypeID('smartObject')))
{
var fs = executeActionGet(ref).getObjectValue(stringIDToTypeID('smartObject')).getString(stringIDToTypeID('fileReference'));
return fs;
}
return '';
};
We have usual smart-object If this function returns <something>.pub and smart-object with ACR-parameters else (for example <something>.cr2)