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

Edit/Rename SmartObject File Reference (Embedded PSB File)

New Here ,
Aug 24, 2016 Aug 24, 2016

Hi,

I'm able to get the File Reference of an embedded Smart Object Layer but I was wondering how to execute the corresponding ActionDescriptor to modify that specific string.

I know that Photoshop changes the name of the temporary PSB file appending numbers every time it's contents gets edited (if there are repeated files sharing the same name at the temp folder). I need more descriptive SmartObject filenames for PSDs already created.

Here my function that returns that string stored at the key4 (fileReference) of desc2 (smartObject)

Still learning how ActionDescriptors / Action Manager Code / Kevlar API works.

function getFileReference() {

    var ref = new ActionReference();

    ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));

    var desc1 = executeActionGet(ref);

    var desc2 = desc1.getObjectValue(stringIDToTypeID('smartObject'));

   

    return desc2.getString(desc2.getKey(4));

}

Thanks!

TOPICS
Actions and scripting
2.4K
Translate
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
Adobe
Community Expert ,
Aug 26, 2016 Aug 26, 2016

I believe you would need to replace the contents of the layers object.  The only way to update the embedded object file is to open the object change the content and commit the changes.  Photoshop will then update the embedded object file. or Use Replace Smart object Layer content. This does not change the associated transform for the object, The new object should be the sane size and resolution of the original object,.

JJMack
Translate
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
New Here ,
Aug 26, 2016 Aug 26, 2016

Thanks JJMack​

I'm only trying to change the actual String of the embedded SO, a way to rename the given filename when that SO was created without embedding a new one, a way to reverse the ActionDescriptor that gets that name and use it to set it. This makes sense?

Translate
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 Expert ,
Aug 26, 2016 Aug 26, 2016
LATEST

To me what your are writing is you are trying to change a smart object layer. I wrote what way I know you can use to change a smart object layer. I do not think the way you are trying to change a smart object layer is posible.

The first time you open a smart  Photoshop will cteate a work file is temp and open it  for you to work on.  This work file  not deleted removed from  temp  if you close the work file till the document containing the smart object is closed.  If  open the smart object after closing the work the work file in temp will be used again.

JJMack
Translate
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