Copy link to clipboard
Copied
HOW CAN I GET THE current selection Pathitems name use script??thank: )! ! ! ! !
Hi pjwaixingren,
Thanks to c.pfaffenbichler and Hope this will help you.
alert(selectedPath().name);
function selectedPath () {
try {
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Path"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);
var theName = desc.getString(charIDToTypeID("PthN"));
return app.activeDocument.pathItems.getByName(theName)
}
catch (e){ return undefined ;}
};
- y
...Copy link to clipboard
Copied
Hi pjwaixingren,
Thanks to c.pfaffenbichler and Hope this will help you.
alert(selectedPath().name);
function selectedPath () {
try {
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID("Path"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
var desc = executeActionGet(ref);
var theName = desc.getString(charIDToTypeID("PthN"));
return app.activeDocument.pathItems.getByName(theName)
}
catch (e){ return undefined ;}
};
- yajiv
Copy link to clipboard
Copied
thank you:)!!