Select inside frame only

Explorer ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

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

ae.JPG

TOPICS
Actions and scripting

Views

212

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Jul 07, 2021 Jul 07, 2021
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.getUnitDouble...

Likes

Translate

Translate
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

Have you read what I wrote to you: Jul 07, 2021

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

If you know the Png Subject is a frame  like you show with an empty images area. You can use the Magic wand to sample the center of the layers bounds to select the empty image ares then the use the bounds of the active selection to get the bounds you want.  Makes no different  what shape the Image area has.  The selection bounds is what you seem to want. The center of a frame will most likely be empty Magic wand should select the image area sampleing the center.

JJMack_2-1625680718737.jpeg

 

 

 

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

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);


Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

Wow @r-bin  You are a God of Photoshop. I am Really Happy To You Knowledge. Many Many Thanks @r-bin 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

This is not related to original question, for what the working solution was already given.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

This is an answer for another topic that someone closed. Who could it be? : )

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

This is another aproach to same problem, after MXKS gave up with this thread 😉

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

Yes @Kukurykus  That was same problem, It helped from @r-bin ,

Thanks @Kukurykus For Help and Guide 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

Once again, why simply you can't answer for that I linked you in this post: Jul 07, 2021

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

If you know the Png Subject is a frame  like you show with an empty images area. You can use the Magic wand to sample the center of the layers bounds to select the empty image ares then the use the bounds of the active selection to get the bounds you want.  Makes no differebcs  what shape the Image area has.  The selection bounds is what you seem to want.

Capture.jpg

JJMack

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

This answer matches the original question. It does "under ratio selection". What's not clear?

Who removed the correct answer? 😠

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 07, 2021 Jul 07, 2021

Copy link to clipboard

Copied

LATEST

Author still did not explain what he means by 'under ratio selection', but due to many first posts of this thread I already left an answer according to that what he wanted: Jul 07, 2021

 

There is not said in his original post he wants to select only inner part of frame as like you see it was already selected. Anyway he accepted solutions to subrequest alike yours, here & here.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines