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

Strange smart-object type

Community Beginner ,
Jan 02, 2018 Jan 02, 2018

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

TOPICS
Actions and scripting

Views

713

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

correct answers 1 Correct answer

Enthusiast , Jan 03, 2018 Jan 03, 2018

var smartObject_FileReference = desc.getObjectValue(stringIDToTypeID('smartObject')).getString(stringIDToTypeID('fileReference'))

I assume that in "desc" variable would be whole layer descriptor.

Votes

Translate

Translate
Adobe
Community Expert ,
Jan 02, 2018 Jan 02, 2018

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.

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
Enthusiast ,
Jan 03, 2018 Jan 03, 2018

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.

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 Beginner ,
Jan 03, 2018 Jan 03, 2018

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

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
Enthusiast ,
Jan 03, 2018 Jan 03, 2018

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.

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 Beginner ,
Jan 05, 2018 Jan 05, 2018

Copy link to clipboard

Copied

LATEST

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)

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