Skip to main content
Participant
October 25, 2011
Question

How to avoid double extension *jpg.tif when exporting layers to files?

  • October 25, 2011
  • 2 replies
  • 1980 views

Please help, I checked all the topics related and it seems nobody bothers about this issue.

When I do a Photomerge of a series of jpg files, Photoshop builds a multilayered file - but preserves in the name of each layer *.jpg 

When I want now to export layers to files, the Scripting function will do the dumb thing and export each file with the original name - ending in JPG - , plus the extension required by me - for ex tif.

It does the same if I chose to export as jpg files and puts double extension again < *.JPG.jpg> at the end of each file exported from a layer.

I looked everywhere and couldn't find a way to solve this behavior, which forces me to do batch renames in Bridge.

The next program where I need the files (After Effects) doesn't want to import these files with double extensions.

Has anyone encountered this issue and what can be done to avoid these double extensions at Scripts/Export layers to files?

Thanks for the answer

This topic has been closed for replies.

2 replies

Paul Riggott
Inspiring
October 25, 2011

I have just altered my script so that it will remove the extentions if found.

http://www.scriptsrus.talktalk.net/Layer%20Saver.htm

Also it would be better to use :-

var layerName = activeDocument.activeLayer.name.replace(/\....$/,'');

As this way it doesn't arbitory remove the last four characters, only if it finds a fullstop.

Chris Cox
Legend
March 23, 2013

Oh, thanks - that was just the operation I was looking for!

Inspiring
October 25, 2011

Uhm,i guess you could remove the last 4 letters of the layername.

var someLayer = activeDocument.activeLayer

var LayerName = String(someLayer.name)

//cuts the .jpg or .tif from the name

someLayer.name = LayerName.substring(0,(LayerName.length - 4))

you just have to build a loop with artLayers.length to change all the Layer names.

Best Regards