Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Multiple selections

Engaged ,
Nov 20, 2013 Nov 20, 2013

I have a white image with some black rectangles on it. The black rectanglest differ in size and number of rectangles per image. They can be selected via layermask.

In short: Does the DOM allow you to specify (a) the number of particular selections in a multiple selection and more importantly (b) are they held in an array so they each selection can be identified, isolated and then worked in in a script?

ie

select all rectangles

work out how many there are

loop over number in selection

     select rectangle

     process selection

end loop

If there isn't, then I'll have to work this out the hard way which'll involve looking over teh image pixel by pixel and identifying shapes.

TOPICS
Actions and scripting
524
Translate
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
Guru ,
Nov 20, 2013 Nov 20, 2013

With the DOM you can check is a selection is one contiguous area with the solid property but that is about it. Rather than checking pixel by pixel you could turn the selection into a temp path. Each of the seperate selected areas will be subpaths in that temp path. The number of subpaths would tell you how many rectangles were selected and you can check the pathPoints to determine the size and position of each rectangle.

Translate
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
Engaged ,
Nov 20, 2013 Nov 20, 2013
LATEST

Thanks, but it might be easier to view the image data after it's been saved out as bmp. The data needs to be pixel accurate and can't have any sub pixel info which might occour from getting a new work path

Translate
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