---
title: "Discussion on \"🎨 Using Python Scripts To Edit Photoshop Layers\" | Hashnode"
description: "Discussion on \"🎨 Using Python Scripts To Edit Photoshop Layers\". I was trying to find out how to create multiple copies of the same image but insert a different line of text from a bank of lyrics I had created.  I then found that using Photoshop you can quite easily manipulate your files with Python, saving them l..."
url: "https://hashnode.com/posts/using-python-scripts-to-edit-photoshop-layers/61ffef123a8a6e5fe1197aac"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [🎨 Using Python Scripts To Edit Photoshop Layers](https://ollierowles.hashnode.dev/using-python-scripts-to-edit-photoshop-layers?utm_source=hashnode&utm_medium=feed)

I was trying to find out how to create multiple copies of the same image but insert a different line of text from a bank of lyrics I had created. I then found that using Photoshop you can quite easily manipulate your files with Python, saving them l...

Feb 6, 2022 · 3 min read · ollierowles.hashnode.dev  
Updated Feb 27, 2022  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#python3](https://hashnode.com/tag/python3)
-   [#script](https://hashnode.com/tag/script)
-   [#photoshop](https://hashnode.com/tag/photoshop)
-   [#art](https://hashnode.com/tag/art)

## Written by

[Ollie Rowles](https://hashnode.com/@ollierowles)

@ollierowles · Oxford, England

  
[View profile](https://hashnode.com/@ollierowles)

Student in Mechatronic Engineering and Computer Science.

## Responses 1

Markdown supported · ⌘↵ to post

[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.
