How to get/make a selection in Photoshop 7

Hi all,

Everything is in the title.

Any one can help ?

TIA.

The following will make a 10x10 square selection.


tell application "Adobe Photoshop 7.0"
	select document 1 region {{0, 0}, {10, 0}, {10, 10}, {0, 10}}
end tell

each coordinate in the region list is a corner point in the selection. you can add more coordinates to change the shape of the selection.

all coordinates are set in pixels.

hth -john

Many thanks, John.

Works like a charm to set a selection.

Now, I need to learn how to GET a selection?

Any one?

What do you mean by “get” a selection?

I mean :

  • open a image file in PSD
  • make a selection with my little hand
  • then get the bounds of this selection by script

something like:
[b]get bounds of selection of document 1[/b]
witch does not work in PSD.

TIA.

That’s not something that is currently scriptable.
You can calculate the size of the current selection (by creating a new document with the contents and then getting the height/width of that), but you can’t get the selection points.

I believe that’s because selections are not restricted to a rectangular selection. This would fail if you had any sort of shape to your selection.

I’m affraid the last solution left to me is to use the GUI Scripting.

Anyway, thanks for help.

ionah,

Were you able to get the selection by using GUI? How did you do it? I would like to do the same thing.

Thanks.

Scott