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

How to get the Smart object linked file location

Explorer ,
Apr 19, 2022 Apr 19, 2022

Copy link to clipboard

Copied

 

Hi everyone,

what a learning curve with this photoshop integration. It is very interesting but also a little bit frustrating.

I got some smart objects and the end goal is to change the linked file locations.

But first I need to know what the current location is.

Has anyone got some very simple code that does it?

Even better if it is VBScript or a bonus point for vb.net but I will take what I can get.

Thanking you very kindly.

Henry

TOPICS
Actions and scripting

Views

2.3K

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

Explorer , Apr 22, 2022 Apr 22, 2022

Firstly thanks to everyone for your help. It was a very painful process but without your help it would of been impossible. 

I followed the links over to (https://community.adobe.com/t5/photoshop-ecosystem-ideas/is-there-an-option-that-shows-me-a-list-with-all-smart-objects-paths/idc-p/12689475)

went through the jscript(??) and slowly translated it vb.net. Very interesting language, very easy to follow. I thought it might be helpful to other people so I posted my code. 

 

top of the class
imports pho
...

Votes

Translate

Translate
Adobe
Community Expert ,
Apr 19, 2022 Apr 19, 2022

Copy link to clipboard

Copied

I am not script guy. There is requested info on Window > Properties panel, just ensure that linked Smart Object is selected in the Layers panel then  open Window > Properties and you should see file location.

linked sm location.jpg

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
Explorer ,
Apr 19, 2022 Apr 19, 2022

Copy link to clipboard

Copied

Actually, I did not know that. I was always baffled on how to see that.  That will come in handy.

But need to be able to script the whole thing. Something like 30 objects per page x 40 something pages and growing. 

Just silly for me to manually.

 

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
Explorer ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

I've also been looking for a way to find the locations and names of my linked files in Photoshop, but for some reason it doesn't work for all files. I have several .mov-files in my photoshop document and when I click on it the properties simply show "no properties". How can I find out the name and location of the mov file? When I dragged it into photoshop it automatically was assigned a layer number instead of keeping its name.

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 ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

@Danny51 – Are you sure that the .mov isn't embedeed?

 

When I drag-n-drop a .mov from the Finder into a Photoshop doc, it is embedded, not linked.

 

Embedded:

embedded.png

 

Linked:
linked.png

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
Explorer ,
Mar 03, 2023 Mar 03, 2023

Copy link to clipboard

Copied

LATEST

So when I drag a move file into an existing photoshop file it gives me a video layer. And if I then turn it into a smart object, it is embedded but still needs a source file - It happened to me that I moved or deleted video files and then photoshop asked me to relink those files - even though they were embedded?

How can I actually get video layers to be IN the document without having to keep a million source files?

 

Screenshot 2023-03-04 at 08.39.39.pngScreenshot 2023-03-04 at 08.39.31.png

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 ,
Apr 20, 2022 Apr 20, 2022

Copy link to clipboard

Copied


@henry22453428ow9z wrote:

I got some smart objects and the end goal is to change the linked file locations.

But first I need to know what the current location is.

Has anyone got some very simple code that does it?



 
A simplistic JS approach for a single active SO layer (this would need to be looped over multiple layers):
app.runMenuItem(stringIDToTypeID('placedLayerEditContents'));
alert(decodeURI(activeDocument.path) + "/" + activeDocument.name);
 
Perhaps the following topic is what you are after:
 
EDIT: While I'm at it, this is also possible with ExifTool:
exiftool -XMP-xmpMM:IngredientsFilePath 'Mac path to/file.psd'

or

exiftool -IngredientsFilePath "Win path to\file.psd"

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
Explorer ,
Apr 22, 2022 Apr 22, 2022

Copy link to clipboard

Copied

Firstly thanks to everyone for your help. It was a very painful process but without your help it would of been impossible. 

I followed the links over to (https://community.adobe.com/t5/photoshop-ecosystem-ideas/is-there-an-option-that-shows-me-a-list-wit...

went through the jscript(??) and slowly translated it vb.net. Very interesting language, very easy to follow. I thought it might be helpful to other people so I posted my code. 

 

top of the class
imports photoshop  


following in a button action, class, function  etc...

      Dim ref
        Dim applicationDesc
        Dim theNumber
        Dim layerDesc
        Dim isSmartObject
        Dim theSO
        Dim theLink
        Dim ps_app As New Photoshop.Application
        ref = New ActionReference
        ref.putProperty(ps_app.StringIDToTypeID("property"), ps_app.StringIDToTypeID("numberOfLayers"))
        ref.putEnumerated(ps_app.CharIDToTypeID("Dcmn"), ps_app.CharIDToTypeID("Ordn"), ps_app.CharIDToTypeID("Trgt"))
        applicationDesc = ps_app.ExecuteActionGet(ref)
        theNumber = applicationDesc.getInteger(ps_app.StringIDToTypeID("numberOfLayers"))

        Dim m = 0
        Dim n = 0

        Do While m <= theNumber
            ref = New ActionReference ' might fall over as it is already declared above
            ref.putIndex(ps_app.CharIDToTypeID("Lyr "), m)
            layerDesc = ps_app.ExecuteActionGet(ref)
            isSmartObject = layerDesc.hasKey(ps_app.StringIDToTypeID("smartObject"))

            If isSmartObject = True Then
                theSO = layerDesc.getObjectValue(ps_app.StringIDToTypeID("smartObject"))
                If theSO.getBoolean(ps_app.StringIDToTypeID("linked")) = True Then
                    theLink = theSO.getPath(ps_app.StringIDToTypeID("link")) ' this will give the path
                End If
            End If

            m = m + 1
        Loop

 

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
LEGEND ,
Apr 22, 2022 Apr 22, 2022

Copy link to clipboard

Copied

Nice job - thanks for sharing vbscript code, unusual for this forum!

 

Moderator - remove extra ')' character from end of link posted by user.

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
Explorer ,
Apr 23, 2022 Apr 23, 2022

Copy link to clipboard

Copied

Yeah, I have not seen much vb code here. There was a bit of a learning process and as I looked over the scripting guide, it seemed so simple and straightforward. But I guess once you know then you know.

Good luck to the next vb scripter, hopefully I have been helpful and given a little bit back.

 

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
LEGEND ,
Apr 20, 2022 Apr 20, 2022

Copy link to clipboard

Copied

sTT = stringIDToTypeID; (ref = new ActionReference())
.putProperty(sTT('property'), sO = sTT('smartObject'))
ref.putEnumerated(sTT('layer'), sTT('ordinal'), sTT('targetEnum'))
executeActionGet(ref).getObjectValue(sO).getPath(sTT('link')).fsName

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