I drag one image from somewhere to ps, and convert to smart object.
can some script to detect the smart object image source path(for example:/Users/robberfree/Desktop/test.jpg)?
thanks a lot.
how to know smart object image source path
-
- Posts: 2
- Joined: Fri Apr 28, 2017 3:19 pm
Re: how to know smart object image source path
if you know how to do it.please give me some tips.
I have read the 《photoshop-cc-javascript-ref-2015》,but not found the according api.
Thanks ahead.
I have read the 《photoshop-cc-javascript-ref-2015》,but not found the according api.
Thanks ahead.
-
- Posts: 26
- Joined: Mon Aug 01, 2016 8:59 pm
Re: how to know smart object image source path
Your crossposting was answered already
https://forums.adobe.com/thread/2310570
https://forums.adobe.com/thread/2310570
-
- Posts: 45
- Joined: Fri Nov 04, 2016 8:29 am
Re: how to know smart object image source path
Correct !
the code provided in the adobe webpage work even on my PS CC.2015
but in order to work you need to convert smart Object to linked (Layer ---> Smart Object ---> Convert to linked).
the code provided in the adobe webpage work even on my PS CC.2015
but in order to work you need to convert smart Object to linked (Layer ---> Smart Object ---> Convert to linked).
Code: Select all
try {
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var layerDesc = executeActionGet(ref);
var soDesc = layerDesc.getObjectValue(stringIDToTypeID('smartObject'));
var thePath = soDesc.getPath(stringIDToTypeID("link"));
alert (thePath);
} catch (e) {};