---
title: "Comment by joão chaves on \"🎨 Using Python Scripts To Edit Photoshop Layers\" | Hashnode"
description: "Hey, thanks a lot for the article. I am trying to rasterize a layer that I imported into a psd document. I posted the question on stack overflow but didn&#39;t"
url: "https://hashnode.com/posts/using-python-scripts-to-edit-photoshop-layers/61ffef123a8a6e5fe1197aac/comment/628693357b02ca162edaf1c3"
---

[Discussion](https://hashnode.com/posts/using-python-scripts-to-edit-photoshop-layers/61ffef123a8a6e5fe1197aac)

Comment [🎨 Using Python Scripts To Edit Photoshop Layers](https://hashnode.com/posts/using-python-scripts-to-edit-photoshop-layers/61ffef123a8a6e5fe1197aac)

[joão chaves](https://hashnode.com/@johanch)

[May 19, 2022](https://hashnode.com/posts/using-python-scripts-to-edit-photoshop-layers/61ffef123a8a6e5fe1197aac/comment/628693357b02ca162edaf1c3)

Hey, thanks a lot for the article. I am trying to rasterize a layer that I imported into a psd document. I posted the question on stack overflow but didn't get any reply.

from photoshop import Session

with Session("C:/Users/Admin/Documents/images/edit\_wall.psd", action="open") as ps:

```
doc = ps.active_document

desc = ps.ActionDescriptor
desc.putPath(ps.app.charIDToTypeID("null"), "C:/CG_CONTENT/wall_height.exr")
event_id = ps.app.charIDToTypeID("Plc ")  # `Plc` need one space in here.
ps.app.executeAction(ps.app.charIDToTypeID("Plc "), desc)

currentLayer = doc.activeLayer

doc.rasterize(currentLayer)
```

Can you point me in the right direction? Thanks.
