File format in Smart Rules

When using Smart Rules, I want to File a document in the Year/Month/Day format.
With the available placeholders this gives me a result like ‘2023/10/07’.
But I want it to be ‘2023/10/7’, so without a zero before month and day.

Before macOS Ventura (I think) you could define a specific date format in the System Preferences. Unfortunately, Apple has removed this option from the System Settings.

I can create the string with the wanted format with Applescript of Javascript, but I don’t know how to get that result in the File field.

Is there a workaround for it?

Currently the only possibility is to use your own script and the Execute Script action.

Thank you for letting me know.
It would be nice if the Custom Metadata format were a bit more flexible, so it would fill this gap.

You can use a string for custom metadata. And you were originally referring to the file name, which can be in the format you describe.

However, using “yyyy/m/d” as a date format (i.e. without leading zeroes for single-digit days and months) might not be such a good idea because then
2023/1/17 is sorted before 2023/1/7 (checked in DT and Numbers). I’d rather go with the ISO date, i.e. “yyyy/mm/dd” which sorts correctly.

Thank you chrillek. I want to have the date in this specific format as a variable (in fact with today’s value), so I do not understand what you mean with your answer.

And yes, I agree the yyyy/mm/dd is better. But not for me ;-).