BUTTON "Rename files based on creation date" :)

Hi, is it possible to add "createddate" to the argument list in the create button panel?

I want to rename several files based on creation date and time, already did that on a rename preset: "{createddate|#yyyyMMdd}{createdtime|#HHmmss}." but it takes several clicks to get it done (choose rename + select preset + accept) plus it doesnt move the newly renamed files to a destination folder.

Since a button can do all that I want to make it available through a button, after reading old posts from Leo I've tried this button code: "Rename PATTERN="." TO="{createdtime|#yyyyMMdd}{createdtime|#HHmmss}." AUTORENAME TYPE=files" but "createdtime" its not available as argument, only current date and time under miscellaneous.

Any solution is welcomed, including an elaborated button code with variables and such or even RegExps... or adding createdtime to the available list of arguments in a future version :slight_smile:

Thanks!

If you want to do everything via a command, you need to add the FILEINFO argument if you want to use file metadata as part of the name:

Rename FILEINFO PATTERN="*.*" TO="{createddate|#yyyyMMdd}_{createdtime|#HHmmss}_*.*" AUTORENAME TYPE=files

(We plan to remove that requirement in the future.)

THANKS LEO! It worked as expected :slight_smile:

However, for some reason, createddate is not always the right date for a pic being taken. Mostly when you copy from an SD CARD to your disk in some cases it just take the copied date as the creation date so I had to use modified in order to rename pictures the way most cellphones do (yyyyMMdd_HHmmss)

Here's the button code to rename files adding modified date:

Rename FILEINFO PATTERN="*.*" TO="{modified|D#yyyyMMdd}_{modified|T#HHmmss}_*.*" AUTORENAME TYPE=files

New question: How can I rename those files without appending the old filename at the end of the new one? (the final "_." part)

original name: DSC2531.JPG
new name: 20160413_120115_DSC2531.JPG
desired name: 20160413_120115.JPG

Tried to remove the fist "" in ".*" but since its a wildcard it wont select any files

PS: Having fun with Opus once again like in the good old AMIGA days :slight_smile:

The created date should be whatever the filesystem says it is. If the filesystem doesn't have the right date then neither will the rename.

If they're JPGs from a camera, you can probably use {datetaken} instead, assuming the camera's clock was set right and the EXIF data hasn't been removed or modified.

Use {ext} if you want the file extension. So _.{ext} at the end.

Thanks Leo, {datetaken} and "_.{ext}" worked perfect!