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

Why is New Smart Object via Copy greyed out for linked Smart Objects?

Community Expert ,
Jan 22, 2024 Jan 22, 2024

Copy link to clipboard

Copied

When I have a Smart Object layer with linked file content, the menu option Layer > Smart Objects > New Smart Object via Copy isn't available. As this is a behavior in both PS 2023 and 2024 it looks like this is intentional. in this case: what's the reason for this? ... or is it simply a bug?

 

ps cc 2023 24.7.2
ps cc 2024 25.3.1
mac os x monterey 12.6.8

TOPICS
macOS

Views

645

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

Community Expert , Jan 22, 2024 Jan 22, 2024

This command only applies to embedded smart objects. There is no way to break the relationship between an original and a copy for a linked file. It makes logical sense (for Photoshop) as this is a linked file. Smart objects have different behaviour than simpler linked files in Illustration or Layout software.

 

The command originated before linked smart objects were available. One could argue that it needs to be renamed to include the word embedded to clarify the intended use now that there are

...

Votes

Translate

Translate
Adobe
Community Expert ,
Jan 22, 2024 Jan 22, 2024

Copy link to clipboard

Copied

This command only applies to embedded smart objects. There is no way to break the relationship between an original and a copy for a linked file. It makes logical sense (for Photoshop) as this is a linked file. Smart objects have different behaviour than simpler linked files in Illustration or Layout software.

 

The command originated before linked smart objects were available. One could argue that it needs to be renamed to include the word embedded to clarify the intended use now that there are both linked and embedded options.

 

You can copy the linked smart object layer using another method and then use the "Convert to Smart Object" command, which will embed the previously linked layer. This isn't intuitive as it's already a smart object, again perhaps the command should now have the word embedded added to clarify what it does.

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 Expert ,
Jan 24, 2024 Jan 24, 2024

Copy link to clipboard

Copied

".... There is no way to break the relationship between an original and a copy for a linked file. It makes logical sense as this is a linked file. ..."
here i disagree: what about a use case where you need to replicate a SMO, let's say with all having the same layer FX applied and then e.g. to reposition these copies in a file and then replace their linked content to different external files. this would be a use case where "New Smart Object via Copy" would absolutely make sense.
e.g. think of an SMO (with a drop shadow and a frame) with several copies containing different artworks to be placed separately on a gallery wall.

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 Expert ,
Jan 24, 2024 Jan 24, 2024

Copy link to clipboard

Copied

As far as I am concerned the term »bug« seems utterly unfit for this issue. 

 

As @Stephen Marsh pointed out, the process could be automated. 

So if it is important to you you may want to create a Script for it. 

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 Expert ,
Jan 25, 2024 Jan 25, 2024

Copy link to clipboard

Copied

Sorry, I posted in the wrong topic, please ignore!

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 Expert ,
Jan 24, 2024 Jan 24, 2024

Copy link to clipboard

Copied

We're going to have to agree to disagree then :]

I'm not talking about use cases, I'm describing the difference between the two types of Smart Objects. A linked SO is fundamentally different to an embedded SO. Photoshop isn't InDesign, links work differently.

 

To break the link to the original, the linked file would need to be duplicated and relinked to the new separate file. It's still linked, just linked to a different file.

 

EDIT: This could of course be automated so that a duplicate file is created and relinked.

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 Expert ,
Jan 25, 2024 Jan 25, 2024

Copy link to clipboard

Copied

The following script can be used to create a New Linked Smart Object via Copy, creating a copy of the original linked file and relinking it to the new file:

 

/*
New Linked Smart Object via Copy.jsx
v1.0 - 25th January 2024, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-discussions/why-is-new-smart-object-via-copy-greyed-out-for-linked-smart-objects/td-p/14371680
CAUTION: The new copy file will overwrite an existing file of the same name! If the linked file was named "my-file.psd" the script will create a new file named "my-file copy.psd" which would overwrite an existing file of the same name.
*/

#target photoshop

// Smart object action manager properties
var ref = new ActionReference();
ref.putProperty(charIDToTypeID("Prpr"), stringIDToTypeID("smartObject"));
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var so = executeActionGet(ref).getObjectValue(stringIDToTypeID("smartObject"));

// Conditional check for the active layer being a linked smart object
if (so.getBoolean(stringIDToTypeID("linked"))) {
    // Single history stage undo
    activeDocument.suspendHistory("New Linked Smart Object via Copy.jsx", "main()");
}


function main() {

    // Doc path, name and extension variables
    var thePath = so.getPath(stringIDToTypeID("link")).fullName.replace(/(^.+\/)(.*)/, '$1');
    var theName = so.getString(stringIDToTypeID("fileReference")).replace(/\.[^\.]+$/, '');
    var theExt = so.getString(stringIDToTypeID("fileReference")).replace(/(.+)(\.[^\.]+$)/, '$2');

    // Duplicate the linked file adding copy to the name
    new File(thePath + theName + theExt).copy(thePath + theName + " copy" + theExt);

    // Set the reference to the original doc name
    var origDocName = activeDocument.name;

    // Dupe the smart object layer to a new temp doc
    function s2t(s) {
        return app.stringIDToTypeID(s);
    }
    var descriptor = new ActionDescriptor();
    var reference = new ActionReference();
    var reference2 = new ActionReference();
    reference.putClass(s2t("document"));
    descriptor.putReference(s2t("null"), reference);
    descriptor.putString(s2t("name"), "tempDoc");
    reference2.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(s2t("using"), reference2);
    descriptor.putString(s2t("layerName"), activeDocument.activeLayer.name);
    executeAction(s2t("make"), descriptor, DialogModes.NO);

    // Relink to the duplicated file copy
    var idplacedLayerRelinkToFile = stringIDToTypeID("placedLayerRelinkToFile");
    var desc15 = new ActionDescriptor();
    var idnull = stringIDToTypeID("null");
    desc15.putPath(idnull, new File(thePath + theName + " copy" + theExt));
    executeAction(idplacedLayerRelinkToFile, desc15, DialogModes.NO);

    // Dupe the relinked temp doc layer back to the original doc
    function s2t(s) {
        return app.stringIDToTypeID(s);
    }
    var descriptor = new ActionDescriptor();
    var reference3 = new ActionReference();
    var reference4 = new ActionReference();
    reference3.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(s2t("null"), reference3);
    reference4.putName(s2t("document"), origDocName);
    descriptor.putReference(s2t("to"), reference4);
    descriptor.putString(s2t("name"), activeDocument.activeLayer.name);
    executeAction(s2t("duplicate"), descriptor, DialogModes.NO);
    activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}

 

CAUTION: The new copy file will overwrite an existing file of the same name! If the linked file was named "my-file.psd" the script will create a new file named "my-file copy.psd" which would overwrite an existing file of the same name.

 

https://prepression.blogspot.com/2017/11/downloading-and-installing-adobe-scripts.html

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 Expert ,
Jan 27, 2024 Jan 27, 2024

Copy link to clipboard

Copied

This 1.1 script version will check if the new copy file exists and cancel the script without overwriting the file:

 

/*
New Linked Smart Object via Copy.jsx
v1.1 - 27th January 2024, Stephen Marsh
https://community.adobe.com/t5/photoshop-ecosystem-discussions/why-is-new-smart-object-via-copy-greyed-out-for-linked-smart-objects/td-p/14371680
NOTE: The script will automatically save a new linked copy of the original linked file adding " copy" to the name.
*/

#target photoshop

// Smart object action manager properties
var ref = new ActionReference();
ref.putProperty(charIDToTypeID("Prpr"), stringIDToTypeID("smartObject"));
ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));
var so = executeActionGet(ref).getObjectValue(stringIDToTypeID("smartObject"));

// Conditional check for the active layer being a linked smart object
if (so.getBoolean(stringIDToTypeID("linked"))) {
    // Single history stage undo
    activeDocument.suspendHistory("New Linked Smart Object via Copy.jsx", "main()");
}


function main() {

    // Doc path, name and extension variables
    var thePath = so.getPath(stringIDToTypeID("link")).fullName.replace(/(^.+\/)(.*)/, '$1');
    var theName = so.getString(stringIDToTypeID("fileReference")).replace(/\.[^\.]+$/, '');
    var theExt = so.getString(stringIDToTypeID("fileReference")).replace(/(.+)(\.[^\.]+$)/, '$2');

    // Duplicate the linked file adding copy to the name
    var theCopy = new File(thePath + theName + " copy" + theExt);
    if (!theCopy.exists) {
        new File(thePath + theName + theExt).copy(thePath + theName + " copy" + theExt);
    } else {
        throw alert('File "' + thePath + theName + theExt + '" exists, script cancelled!');
        //throw null;
    }

    // Set the reference to the original doc name
    var origDocName = activeDocument.name;

    // Dupe the smart object layer to a new temp doc
    function s2t(s) {
        return app.stringIDToTypeID(s);
    }
    var descriptor = new ActionDescriptor();
    var reference = new ActionReference();
    var reference2 = new ActionReference();
    reference.putClass(s2t("document"));
    descriptor.putReference(s2t("null"), reference);
    descriptor.putString(s2t("name"), "tempDoc");
    reference2.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(s2t("using"), reference2);
    descriptor.putString(s2t("layerName"), activeDocument.activeLayer.name);
    executeAction(s2t("make"), descriptor, DialogModes.NO);

    // Relink to the duplicated file copy
    var idplacedLayerRelinkToFile = stringIDToTypeID("placedLayerRelinkToFile");
    var desc15 = new ActionDescriptor();
    var idnull = stringIDToTypeID("null");
    desc15.putPath(idnull, new File(thePath + theName + " copy" + theExt));
    executeAction(idplacedLayerRelinkToFile, desc15, DialogModes.NO);

    // Dupe the relinked temp doc layer back to the original doc
    function s2t(s) {
        return app.stringIDToTypeID(s);
    }
    var descriptor = new ActionDescriptor();
    var reference3 = new ActionReference();
    var reference4 = new ActionReference();
    reference3.putEnumerated(s2t("layer"), s2t("ordinal"), s2t("targetEnum"));
    descriptor.putReference(s2t("null"), reference3);
    reference4.putName(s2t("document"), origDocName);
    descriptor.putReference(s2t("to"), reference4);
    descriptor.putString(s2t("name"), activeDocument.activeLayer.name);
    executeAction(s2t("duplicate"), descriptor, DialogModes.NO);
    activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}

 

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 Expert ,
Sep 08, 2024 Sep 08, 2024

Copy link to clipboard

Copied

LATEST

A new related script here:

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/please-fix-how-relink-to-file-and-rep...

 

This script links to an existing file, rather than creating a new copy of the current linked file.

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