Update linked smart objects broken file path
Our main image folder has been renamed, now many linked smart objects have a wrong path, and when opening the psd, photoshop asks me to update the path.
I would like to run a script and change the path to the new one. Is this even possible?
What I have so far, I can read the file path from a linked smart object like this:
var ref = new ActionReference();
ref.putIdentifier(charIDToTypeID('Lyr '), oObj.id );
var desc = executeActionGet(ref);
var smObj = desc.getObjectValue(stringIDToTypeID('smartObject'));
var sLocalFilePath = smObj.getPath(stringIDToTypeID('link'));
But this will give me the path if the file is correctly linked only. For broken file links getPath(stringIDToTypeID('link') is not available.
Is there a way to read the file path, if the linked file has been moved?
And is it possible to update the path via script then?
