Answered
Select inside frame only
I will try Another PNG File But Select All , I want to inside frame only

I will try Another PNG File But Select All , I want to inside frame only

For your examples, this is to poke a magic wand in the center of the layer.
var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("bounds"));
r.putEnumerated(stringIDToTypeID("layer"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
var d = executeActionGet(r).getObjectValue(stringIDToTypeID("bounds"));
var x0 = d.getUnitDoubleValue(stringIDToTypeID("left"));
var x1 = d.getUnitDoubleValue(stringIDToTypeID("right"));
var y0 = d.getUnitDoubleValue(stringIDToTypeID("top"));
var y1 = d.getUnitDoubleValue(stringIDToTypeID("bottom"));
var d = new ActionDescriptor();
var r = new ActionReference();
r.putProperty(stringIDToTypeID("channel"), stringIDToTypeID("selection"));
d.putReference(stringIDToTypeID("null"), r);
var d1 = new ActionDescriptor();
d1.putUnitDouble(stringIDToTypeID("horizontal"), stringIDToTypeID("pixelsUnit"), (x0+x1)/2);
d1.putUnitDouble(stringIDToTypeID("vertical"), stringIDToTypeID("pixelsUnit"), (y0+y1)/2);
d.putObject(stringIDToTypeID("to"), stringIDToTypeID("point"), d1);
d.putInteger(stringIDToTypeID("tolerance"), 255);
d.putBoolean(stringIDToTypeID("merged"), true);
d.putBoolean(stringIDToTypeID("antiAlias"), true);
executeAction(stringIDToTypeID("set"), d, DialogModes.NO);
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.