Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Photoshop Help



On 6/30/06 12:34 PM, Monte Babington wrote:

> The trouble is that I need the selection to be in the shape of a layer.
> I'll use that selection to delete an area of another layer later in the
> script.
> 
> I tried using the select all method and then pasting to an alpha channel,
> but the position changes.  So my question is:
> 
> Does anyone know how to either:
> 
> 1) Use the current layer to generate a selection shape
> 
> 2)  Generate an alpha channel from the current layer without changing
> position?


Okay, this one is REALLY ugly, but it works. For some reason, moving the
layer's content forces the selection to conform to the layer. (This is a
trick I discovered in the GUI that just happens to work via script, as
well.)

tell application "Adobe Photoshop CS2"
    tell document 1
        set current layer to layer "Layer 1"
        select all
        translate layer "Layer 1" delta x 1 -- move 1 pixel right
        translate layer "Layer 1" delta x -1 -- move back 1 pixel left
    end tell
end tell

Stan Cleveland
Color Technology Inc.
Portland, Oregon

"It isn't pollution that's harming the environment. It's the impurities in
our air and water that are doing it." -- Former U.S. Vice President Dan
Quayle


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden

References: 
 >Re: Photoshop Help (From: Monte Babington <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.