Naming files sequentialy

Things I have tried

I have found a way to rename the file once it is created using the templater plugin.
The approach below will rename the file:

<% tp.file.rename("meeting-scrum" + tp.date.now("DD-MMM-YYYY")) %>

What I’m trying to do

I have multiple folders and inside each folder there are several files. Each file is named using the following format

xnnn - file summary

Examples:

T001 - Monday 25OCT01 Garden view
T002 - Tuesday 03NOV22 Balcony construction

The files can be in multiple folders:

folder1
	T001 - 28OCT01 Garden view
	T002 - 07NOV22 Balcony construction
folder2
	T002 - 07NOV22 Balcony construction
	folder2.1
		T001 - 26OCT01 Garden view
		T002 - 05NOV22 Balcony construction
folder3
	T003 - 24OCT01 Garden view
	T004 - 03NOV22 Balcony construction
folder4
	T006 - 22OCT01 Garden view
	T007 - 01NOV22 Balcony construction

As you can see, the Prefix includes some that are duplicates (e.g T001 and T002)
What i would like to do is to automatically rename the file but the prefix to always be higher than the last highest value. In the above example, the name for the next note created should be T008 - DDMMMYY - Summary

Is there anyway i can automate this? i.e to check all files in all folders that have a specific tag and calculate the next value in the sequence?

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