Skip to main content
toddl62332479
Participant
May 22, 2017
Question

How can I modify IPTC headers with JSX script, without opening images.

  • May 22, 2017
  • 2 replies
  • 4265 views

I'd like to use Photoshop, and scripting, to modify several IPTC fields in a JPEG, without actually opening the JPEG, and then also rename the JPEG.

Right now, I've got a .JSX script I wrote that will do the following:

1) Ask the user to point to a directory containing JPEG files

2) Ask the user to input a caption

3) Open each JPEG in the directory, modify the Author, Caption, and several other fields

4) Save-As the JPEG to a new directory, with a different name

5) Close the JPEG

This JSX works great right now.  But if there are 100 images, then it take a long time to complete this task.

I have another .JSX script that will complete some of this work without opening the JPEG in Photoshop.  But this .JSX script only modifies XMP data.  That information is not visible from the Windows file system when I right-click and ask for "details."

How can I write a .JSX script to modify the IPTC metadata without actually opening the JPG, and how can I get Photoshop to rename the file as well?

Thanks,

This topic has been closed for replies.

2 replies

Participating Frequently
April 16, 2019

Bonjour

You can also use ExifTool on the command line - see HERE

JJMack
Community Expert
Community Expert
May 22, 2017

Photoshop can not rename files but you can use Javascript file system support to rename files.    For Photoshop to change IPTC metadata not only would it need to open the files it would also need to write the file.  The Bridge can read and write metadata without opening the document in Photoshop and Bridge can rename files.   Bridge can be scripted but I have never written a Bridge script and there is some kind a Bridge Talk interface between Bridge scripts and Photoshop scripts.  You may want to look at Bridge scripting.

JJMack
toddl62332479
Participant
May 22, 2017

In the last couple of hours, I've written a script that allows Photoshop to modify IPTC information without opening the JPG, and also allows it to rename the JPG without opening or re-saving it.

What I'm missing now is an understanding of how to identify all the metadata that it's possible to change, and how to do that. I can change author and description and copyright notice.  But I want to modify more.

How can I insert my code here to share, and not have it look like a mess?

SuperMerlin
Inspiring
May 22, 2017

It would help if you mentioned what fields you want to deal with, as not all fields require the same code.