Thread View: adobe.photoshop.scripting
7 messages
7 total messages
Started by Luis_Morcillo
Fri, 20 Mar 2009 09:47
Why can't I do "layer.kind = LayerKind.SMARTOBJECT;"?
Author: Luis_Morcillo
Date: Fri, 20 Mar 2009 09:47
Date: Fri, 20 Mar 2009 09:47
5 lines
1126 bytes
1126 bytes
I want to save each image layer from a PSD separately, and if the image has an effect OR its opacity is < 100%, it needs to be converted to an SmartObject layer and then rasterized (so it becomes a "LayerKind.NORMAL" layer with its effect, rasterized). I can do it in two clicks, but when I try to do it by scripting, I get an alert saying something like "ArtLayers can't be converted to SmartObjects". I think that makes no sense, because you can do it by right-clicking a layer a selecting "Create smartObject", but whatever... Is there a workaround for this?
Re: Why can't I do "layer.kind = LayerKind.SMARTOBJECT;"?
Author: Paul_R
Date: Fri, 20 Mar 2009 10:38
Date: Fri, 20 Mar 2009 10:38
1 lines
646 bytes
646 bytes
You will have to use ScriptListener to do this.
Re: Why can't I do "layer.kind = LayerKind.SMARTOBJECT;"?
Author: Luis_Morcillo
Date: Fri, 20 Mar 2009 13:12
Date: Fri, 20 Mar 2009 13:12
3 lines
932 bytes
932 bytes
Thanks Paul! But wow, I don't understand that code at all (lol). Do the "201" and "89" stand for something or are they just random numbers? On the other hand, my problem is not to rasterize, but to convert a LayerKind.NORMAL to LayerKind.SMARTOBJECT, and I don't see that in the code (maybe it is there but I can't see it).
Re: Why can't I do "layer.kind = LayerKind.SMARTOBJECT;"?
Author: Paul_R
Date: Fri, 20 Mar 2009 14:01
Date: Fri, 20 Mar 2009 14:01
10 lines
952 bytes
952 bytes
Yes its all scriptListener code auto generated with the ScriptListner plugin.
this line..
executeAction( stringIDToTypeID('newPlacedLayer'), undefined, DialogModes.NO );
converts the normal layer to a smart layer.
The function will rasterize the layer.
The layer must be the active one.
the "201" and "89" are just auto generated variables.
Re: Why can't I do "layer.kind = LayerKind.SMARTOBJECT;"?
Author: christoph_pfaffenbichler
Date: Sat, 21 Mar 2009 14:01
Date: Sat, 21 Mar 2009 14:01
2 lines
838 bytes
838 bytes
Luis, isn๏ฟฝt going via Smart Objects more time-intensive than grouping the layer and then merging the resulting group? But of course that would trash existing Clipping Masks ๏ฟฝ
Re: Why can't I do "layer.kind = LayerKind.SMARTOBJECT;"?
Author: Luis_Morcillo
Date: Sat, 21 Mar 2009 15:02
Date: Sat, 21 Mar 2009 15:02
1 lines
798 bytes
798 bytes
The purpose is to apply layer masks and effects and get just a rasterized layer, so that would be a great and easy way to do it. I'll try and tell you ;) Thanks!
Re: Why can't I do "layer.kind = LayerKind.SMARTOBJECT;"?
Author: Luis_Morcillo
Date: Tue, 24 Mar 2009 08:49
Date: Tue, 24 Mar 2009 08:49
1 lines
758 bytes
758 bytes
Done! It was a bit difficult to obtain exactly what I needed, but the group->merge solution has worked perfectly. Thank you very very much Christoph! :D
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads