ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: skern on April 13, 2020, 09:05:27 PM

Title: Batch Renaming Photoshop.psd Files From TextLayerText with Multiple Text Layers
Post by: skern on April 13, 2020, 09:05:27 PM
I have several slides that all have 3 text layers (title, author, filename).  The problem is I am trying to batch rename these files using the "filename" text layer.  Here is the meta tag info:

Text Layer Name                 : Title, Author, filename
Text Layer Text                 : Welcome and Introductions, Christopher Ahmad MD, iem-testdata\script\09-20-19_Americana_Ball_0725_Ahmad.avs

I use this command line:

exiftool "-FileName<${XMP-photoshop:TextLayerText;tr/-_0-9a-zA-Z//dc}.%e" "Y:\iem-testdata\gfx\TitleSlides"

The result is a filename that is a concatenation of all 3 text layers instead of just the "filename"

filename result:  "Y:\iem-testdata\gfx\TitleSlides\WelcomeandIntroductionsChristopherAhmadMDiem-testdatascript09-21-19_Americana_Ball_0725_Ahmadavs.psd"

I think the solution may be in the regex but I'm not too good at manipulating string data.  Is there a way to just get the filename from the Text Layer Text tag?
Title: Re: Batch Renaming Photoshop.psd Files From TextLayerText with Multiple Text Layers
Post by: Phil Harvey on April 14, 2020, 06:31:34 AM
Try this:

exiftool "-FileName<${XMP-photoshop:TextLayerText;s/.*,\s*//;tr/-_0-9a-zA-Z//dc}.%e" "Y:\iem-testdata\gfx\TitleSlides"

- Phil
Title: Re: Batch Renaming Photoshop.psd Files From TextLayerText with Multiple Text Layers
Post by: skern on April 17, 2020, 02:18:04 AM
Oh yeah!  That did it.  I thought I would post the command that works great on Windows CMD batch script.  I just hit the donate button as well.  This is an amazing tool.

exiftool "-FileName<${XMP-photoshop:TextLayerText;s/.*,\s*//;tr/-_0-9a-zA-Z//dc}" "%CD%" > title-log.txt 2>&1
Title: Re: Batch Renaming Photoshop.psd Files From TextLayerText with Multiple Text Layers
Post by: Phil Harvey on April 17, 2020, 07:51:07 AM
I got your donation, thanks!

- Phil