Photoshop layer mask scripting - stumped
Photoshop layer mask scripting - stumped
- Subject: Photoshop layer mask scripting - stumped
- From: Roger Howard <email@hidden>
- Date: Mon, 13 Sep 2004 17:12:22 -0700
Ok, so far I've been able to eventually come to grips with the vagaries
and idiosyncrasies in Photoshop CS. I'm a longtime Photoshop user and
trainer, but wrestling with the scripting implementation sometimes
feels like a parallel tool more than a logical exposing of the
underlying object model. Anyway, I digress...
Today, my goal is relatively straightforward, or so I thought. Here's
the simplified scenario:
I have two files; each file has 2 or more layers; let's call these
files A and B
A and B have the same number of layers, named the same way, none of
which are in layer sets
In A, every layer has a layer mask
In B, layers may or may not have layer masks
The goal: to transfer the layer mask from each layer in A to the layer
of the same name in B.
If I were doing it manually:
1) Select the target layer in B
2) Select the source layer in A; load its layer mask as a selection
3) Use Save Selection to save the current selection (in A) into the
layer mask of the selected layer in B
Unfortunately, I'm at a standstill. I cannot even find a way to
reference a layer's layer mask, as a property or child of the layer
object. The only way I can figure out how to load a layer mask as a
selection via AppleScript is to set the current layer, then use an
Action to Load Selection - not ideal. Likewise, I cannot see how to
transfer this selection to a layer mask in another document, primarily
because, again, I have no clue how to reference Layer Masks.
Even though a layer mask can be worked with as a pseudo channel in
Photoshop, layer masks don't appear to be included in the channels
object - so even when I see 4 channels (3 for RGB, plus an italicized
Layer Mask channel) iin the channels palette, getting (names of every
channel) does not include the layer mask.
I don't need help with the logic of the script, so I haven't even
bothered to post any code here - I'm just grappling with the object
model. Any Photoshop scripters out there please take mercy!
First, how do I get a layer mask of a layer?
Since there's a load selection, but not a save selection, command in
the object model, is it possible to use this to copy a selection over?
Otherwise, what's the fastest way to transfer a selection from one
document to another (specifically, from a layer mask in one document to
a layer mask in another)?
There's the really ugly and slow way which I can piece together using
judicious use of the clipboard and Actions, but I'd really rather not -
mostly because I hate feeling defeated by an object model :)
roger howard
email & im @ <email@hidden>
photos @ <http://www.pbase.com/rogerhoward>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden