• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get all layer (even in layer sets) in Photoshop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get all layer (even in layer sets) in Photoshop


  • Subject: Re: How to get all layer (even in layer sets) in Photoshop
  • From: Richard Rönnbäck <email@hidden>
  • Date: Mon, 14 Dec 2009 08:01:08 +0100
  • Thread-topic: How to get all layer (even in layer sets) in Photoshop

Title: Re: How to get all layer (even in layer sets) in Photoshop
Photoshop does not seem to have a "get all layers" command, so you will probably have to use a recursive loop, something along those lines:

global myLayerList
set myLayerList to {}


tell
application "Adobe Photoshop CS4"
   tell
document 1
        my doGetLayers(
layers)
        return myLayerList
   end tell
end
tell


on doGetLayers(myCurrentLayers)
    tell
application "Adobe Photoshop CS4"
       repeat with i from 1 to
count myCurrentLayers
           
            set myLayer to
item i of myCurrentLayers
           
            if
class of myLayer is art layer then --this is where you evaluate if the layer is of the kind you want
               set end of myLayerList to myLayer
           else if
class of myLayer is layer set then
               my doGetLayers(
layers of myLayer)
            end if
           
        end repeat
   end tell
end
doGetLayers


A quick test indicates that the above work, but I haven't tried for all the various types of effects, layer masks, layer styles etc. that Photoshop has, and that you may, or may not, care for.




From: Leo Law <email@hidden>
Date: Sat, 12 Dec 2009 14:40:21 -0800
To: <email@hidden>
Subject: How to get all layer (even in layer sets) in Photoshop

Dear all,

How does one get all the layers in a Photoshop document in list, even if they are in layer sets?

I want to be able to repeat though all the layers in the list after I have it.

Thanks,
Leo
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >How to get all layer (even in layer sets) in Photoshop (From: Leo Law <email@hidden>)

  • Prev by Date: RE : Modified "modification date" [Solved... almost]
  • Next by Date: Re: Modified "modification date" [Solved... almost]
  • Previous by thread: How to get all layer (even in layer sets) in Photoshop
  • Next by thread: Re: How to get all layer (even in layer sets) in Photoshop
  • Index(es):
    • Date
    • Thread