Copy link to clipboard
Copied
Hi all,
I'm trying to find a script that will simply convert a "live shape" to a normal shape so I can scale the shape while keeping the corner radius static.
I've looked through this thread and none of the code there worked for me.
My scripting skills are relatively terrible, and I've given up after a few hours of trying to hack together some JSX myself.
Any help would be greatly appreciated.
Copy link to clipboard
Copied
Does it have to be a script?
All it takes is adding or removing a single anchor point to a live shape to "degrade" it into a standard shape.
Much easier for a human to decide where to add the additional anchor point so as not to distort the vector.
Copy link to clipboard
Copied
Well, I've been using that hack - a variation of it - I just nudge a vertex out and back. I guess I was just hoping there was a script out there that would just eliminate the need for the hack.
R-Bin posted this code that duplicates a selected path:
function dup_to_wrk_path(id) {
try {
var d = new ActionDescriptor();
var r = new ActionReference();
if (id == undefined) r.putEnumerated(stringIDToTypeID("path"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
else if (typeof(id) == "string") r.putName( charIDToTypeID( "Path" ), id);
else r.putIdentifier( charIDToTypeID( "Path" ), id);
var path = executeActionGet(r).getObjectValue(stringIDToTypeID("pathContents"));
var list = path.getList(stringIDToTypeID("pathComponents"));
var r = new ActionReference();
r.putProperty( charIDToTypeID( "Path" ), charIDToTypeID( "WrPt" ) );
d.putReference( stringIDToTypeID( "null" ), r );
d.putList(charIDToTypeID("T "), list);
executeAction(charIDToTypeID("setd"), d, DialogModes.NO);
return true;
} catch (e) {
alert(e);
return false;
}
}
I can successfully get that to work, but I can't figure out the remaining steps of converting the path into a complete shape object.