Bulk Rename Attachments with File name prefix

Trying to rename all my note attachment and prefix them with file name and a random number (whatever makes them unique).

I have hundred of notes, How can I accomplish this?

Could anyone please suggest a solution?

i don’t know about plugins… this is an outside of obsidian job…

we need to rename actual images and their references in the markdown file, making sure the changes happen in a loop

some information is needed:

  • OS
  • folder of attachments (consistently in folder below markdown file’s level or elsewhere or completely random)
  • is filename_image1.jpg or such is my filename_image2.png or such_is_my_filename_image3.gif or suchismyfilename_image45565.png preferred – asking because down the road it’s better to not have any spaces between strings in filenames and image numbering with suffixes _image1, etc. seem straightforward and logical – if anyone wants to help here they need to cater to anybody’s needs for posterity and any participants here should vote for the most logical naming conventions
    • obsidian doesn’t really have a problem with spaces in filenames but we need compatibility with any markdown app
  • macOS 14.5 (23F79)
  • attachments folders. This resides inside each folder - each folder has it’s own attachments
  • attachments names have spaces in them. Very arbitrary. My preferred attachment name would be <notename>_<random number/date>

okay, so shell script or python it will be (i prefer the latter but it needs an env setup)
attachments is straightforward
date suffix is doable based on creation date

1am here so my time is up for today… maybe tomorrow…?

…found another problem…

…post deleted…

over and out…sorry…

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