How to bulk rename using modified timestamp and without breaking links?

What I’m trying to do

Hi there, in order to have better control over my attachments, I recently installed Paste Image Rename that allows me to add a timestamp like YYYY-MM-DD_hh-mm-ss_ and then select a name for my image. It allows me to have control over my usefull attachments, and being able to delete with the plugin clear unused image with more clarity.

But I do have like 250 images that needs renaming to follow that convention. I would like to rename them based on their modified time, which means the time they were added to my vault. And then select a name.

Is there a way, inside obsidian to preserve note linking, to modify these links in order to have the modified date timestamp and gain some time. Thanks in advance !

Things I have tried

I tried using some simple scripting or bulk renamer utility but it breaks obsidian linking.

Thanks in advance if you know of a plugin or something !

If you use a plugin function related to renaming files it should not break links. If you use pure javascript functsion that’s another case.

My recommendations, which I used in a similar case, is to build a Templater template, and use the tp.file.rename() function.

Build some query to get all of your files, and use that function to do the actual renaming.

I’m kind of surprised that the bulk renamer utility broke your links, without actually having used it, but I kind of expect that functionality to be its main reason for existing. So that was a little strange.

Anyways, I’ve used Templater for this purpose, and in my experience, that worked beautifully.

It seams like you’re capable of scripting this yourself, so I’m just presenting the tools needed. Please come back asking for advice if you’re having more issues, or want to verify your script, or similar.

I don’t know much about scripting except for some python or shell. Javascript is entirely unknown but I do have the templater plugin if you have some old script to share !

Bulk Rename Utility is a windows software, not a plugin that I used, hence why it broke linking.

Thanks for your answer, much appreciated !

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.