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

How to rasterize smart object layers with scripting

New Here ,
Jul 06, 2020 Jul 06, 2020

Copy link to clipboard

Copied

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

Views

2.8K

Translate

Translate

Report

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)
 

Votes

Translate

Translate
Adobe
People's Champ ,
Jul 06, 2020 Jul 06, 2020

Copy link to clipboard

Copied

Have you read about the rasterize function in the documentation?

Use instead
rasterize (LayerKind.SMARTOBJECT)
valid argument, e.g.
rasterize (RasterizeType.ENTIRELAYER)
 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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? 🙂

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

Votes

Translate

Translate

Report

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