Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to rasterize smart object layers with scripting

New Here ,
Jul 06, 2020 Jul 06, 2020

Hi!

I'm pretty new on photoshop scripting. I see there's a rather obscure way I can't even understand ðŸ˜….

 

I've tried iterating though layers, detecting that it's a smart layer, but I can't seem to raster it. Ex, I tried this:

if(layerRef.kind == LayerKind.SMARTOBJECT) {
layerRef.rasterize(LayerKind.SMARTOBJECT)
}

And I'm getting:

Runtime Error: Error Code# 1227: Illegal argument - argument 1
- Wrong type of enumerated value @ file '' [line:0, col:NaN

 

Eventually, I would like to be able to raster smart objects, and then re-create that raster content into a smartobject again.

 

For the moment, I don't care much about performance, I just want this to work as readable as possible.

 

Thanks!!

TOPICS
Actions and scripting
3.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Jul 06, 2020 Jul 06, 2020
Have you read about the rasterize function in the documentation?

Use instead
rasterize (LayerKind.SMARTOBJECT)
valid argument, e.g.
rasterize (RasterizeType.ENTIRELAYER)
 
Translate
Adobe
People's Champ ,
Jul 06, 2020 Jul 06, 2020
Have you read about the rasterize function in the documentation?

Use instead
rasterize (LayerKind.SMARTOBJECT)
valid argument, e.g.
rasterize (RasterizeType.ENTIRELAYER)
 
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 06, 2020 Jul 06, 2020

haha! that made it work! 

I've check the Photoshop Scripting Guide and Photoshop JavaScript Reference, I still don't see much info about the rasterize method.

 

Any help or directions on searching for creating a smart object from a given layer? 🙂

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jul 06, 2020 Jul 06, 2020
LATEST
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines