5 Replies Latest reply on Jan 5, 2018 1:06 PM by littlehorse3

    Strange smart-object type

    littlehorse3 Level 1

      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

        • 1. Re: Strange smart-object type
          Chuck Uebele Adobe Community Professional & MVP

          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.

          • 2. Re: Strange smart-object type
            Jarda Bereza Level 4

            ad 1)

            layer descriptor > smartObject > fileReference: "myfile.ext"


            You can have list of all Raw file extensions and check if filereference has this extension.

            • 3. Re: Strange smart-object type
              littlehorse3 Level 1

              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

              • 4. Re: Strange smart-object type
                Jarda Bereza Level 4
                var smartObject_FileReference = desc.getObjectValue(stringIDToTypeID('smartObject')).getString(stringIDToTypeID('fileReference'))


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

                • 5. Re: Strange smart-object type
                  littlehorse3 Level 1

                  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);  



                  var fs = executeActionGet(ref).getObjectValue(stringIDToTypeID('smartObject')).getString(stringIDT oTypeID('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)

                  1 person found this helpful