Changing the File Extension

Post Reply
MikeNaylor
Posts: 102
Joined: 13 Nov 16 13:40
Location: Spain
Contact:

Changing the File Extension

Post by MikeNaylor »

When renaming files, is there a way to change the file extension to lowercase? For example changing Filename.DNG to Filename.dng. I can see an option to extract the Original File Extension and change that to lowercase, but I can't see a way to remove or change to file extension.
Apple iMac (Retina 5K, 27-inch, Late 2015), macOS Mojave, Photo Supreme 4, Lightroom CC Classic.
DirkS
moderator
Posts: 284
Joined: 25 May 08 13:28
Location: Essex, UK

Re: Changing the File Extension

Post by DirkS »

This works for me:
Switch to 'edit as text and enter

Code: Select all

%FileName.%FileExtension{lowercase=y}
You can also achieve this in the GUI editor, but above method is quicker
Problems searching the forum? Try Google Site Search by adding 'site:forum.idimager.com' to a standard Google search.
MikeNaylor
Posts: 102
Joined: 13 Nov 16 13:40
Location: Spain
Contact:

Re: Changing the File Extension

Post by MikeNaylor »

Thanks DirkS. You've encouraged me to learn a little about scripting.
Apple iMac (Retina 5K, 27-inch, Late 2015), macOS Mojave, Photo Supreme 4, Lightroom CC Classic.
MikeNaylor
Posts: 102
Joined: 13 Nov 16 13:40
Location: Spain
Contact:

Re: Changing the File Extension

Post by MikeNaylor »

DirkS - Just tried your code, but it doesn't work as expected.

Example: L1000621.DNG changes to L1000621.dng.DNG

As I said, I cannot find a way to extract just the filename without the extension. I've tried all the Left, Mid and Right variants, but these can't be used when selecting multiple files with varying name lengths.

Anymore suggestions?
Apple iMac (Retina 5K, 27-inch, Late 2015), macOS Mojave, Photo Supreme 4, Lightroom CC Classic.
sanphotgn
Posts: 334
Joined: 26 Aug 07 17:06

Re: Changing the File Extension

Post by sanphotgn »

DirkS' script works here on Windows. I selected multiple files for the test.

MikeNaylor - after you enter the script as text in the Macro Text window and click on OK to return to the Rename window, where you see a kind of graphical representation of the script / macro, do you see the original file name and the new file name near the top of Rename window? Note - you haven't applied the script / macro yet. Is the new file name L1000621.DNG or L1000621.dng.DNG?
Photo Supreme 6.7.2.4201 (64 bits) (Windows)
MikeNaylor
Posts: 102
Joined: 13 Nov 16 13:40
Location: Spain
Contact:

Re: Changing the File Extension

Post by MikeNaylor »

The new (suggested) file name is L1000621.dng.DNG. I'm beginning to think this yet another issue that is Mac specific. Its often the case with multi platform software. Windows always seems to get priority support.
Apple iMac (Retina 5K, 27-inch, Late 2015), macOS Mojave, Photo Supreme 4, Lightroom CC Classic.
sanphotgn
Posts: 334
Joined: 26 Aug 07 17:06

Re: Changing the File Extension

Post by sanphotgn »

The graphical representations of the the script / macro in the Rename window on Windows:

Rename.PNG
Rename.PNG (26.28 KiB) Viewed 8570 times

Do you see the same, except for the double file extension in the new (suggested) file name?
Photo Supreme 6.7.2.4201 (64 bits) (Windows)
MikeNaylor
Posts: 102
Joined: 13 Nov 16 13:40
Location: Spain
Contact:

Re: Changing the File Extension

Post by MikeNaylor »

Thanks sanphotogn, but that's exactly what doesn't work on a Mac. Your example would appear as N2016F3107.nef.NEF.
Last edited by MikeNaylor on 17 Dec 17 9:02, edited 1 time in total.
Apple iMac (Retina 5K, 27-inch, Late 2015), macOS Mojave, Photo Supreme 4, Lightroom CC Classic.
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: Changing the File Extension

Post by Hert »

MikeNaylor wrote: 15 Dec 17 13:41 The new (suggested) file name is L1000621.dng.DNG. I'm beginning to think this yet another issue that is Mac specific. Its often the case with multi platform software. Windows always seems to get priority support.
That's not true. PSU was built from the ground up for both platforms. And PSU uses an identical code base for both platforms...meaning they are exactly the same, feature-wise.
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
DirkS
moderator
Posts: 284
Joined: 25 May 08 13:28
Location: Essex, UK

Re: Changing the File Extension

Post by DirkS »

I experimented some more and there may be a bug. (NB this is on Windows)

If I start in the GUI and select Filename it shows up as a single block in the GUI with the text %Filename.
Renaming preview shows name + extension.

If I then select 'edit as text it shows up as

Code: Select all

%FileName.%FileExtension
If I add '{lowercase=y}' to it and confirm the GUI shows 3 blocks: Filename, the dot and FileExtension.

My conclusion is that there's something wrong with the preset (or its handling)

EDIT: the preset is fine. Somehow PSu has a problem whe it processes the preset.
AFAICT 'edit as text' works fine
Problems searching the forum? Try Google Site Search by adding 'site:forum.idimager.com' to a standard Google search.
endre
Posts: 19
Joined: 27 Apr 18 22:35

Re: Changing the File Extension

Post by endre »

Let me dust off this old topic with a recent challenge. Some of my older photos have mixed JPG / JPEG extension.

%FileName.%FileExtension{lowercase=y} this code makes either file.jpg or file.jpeg but there is still a character difference.

With a 3rd party rename utility I could easily sort this out but the files are catalogued, labeled etc., so would not mess with them outside of Photo Supreme. Any hints?
Hert
Posts: 7870
Joined: 13 Sep 03 6:24

Re: Changing the File Extension

Post by Hert »

If you're only using this on jpg/jpeg files then use this rename rule:

Code: Select all

%FileName.jpg
This is a user-to-user forum. If you have suggestions, requests or need support then please send a message
endre
Posts: 19
Joined: 27 Apr 18 22:35

Re: Changing the File Extension

Post by endre »

worked like a charm...
thanks for the quick solution Hert
Post Reply