Re: How to get all layer (even in layer sets) in Photoshop
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