Renaming, change date format from custom metadata

Your short data string may not be returning with delimiters, like a hyphen.

What do you get when you run…

short date string of (current date)

I get


so no delimiters at all.

And now having tested it in Script Debugger I can see that I didn’t need to do all that reformatting of the date in script. I still need to use the Script for renaming the file to get the custom metadata date into YYYYMMDD form but its much simpler to do with my date settings as it formats the date in the way I want it without any manipulation. Well I have learnt a few things about scripting doing it this way.

And now the script is working exactly as I need it to. It’s much simpler and it can leave the account number out if there isn’t one. Great stuff.

The date formats, including short date, are defined in System Preferences > Language & Region > Dates

Glad you have you script working and you learned new things. Even more glad to hear the enjoyment and sense of accomplishment in your post. :heart: :slight_smile: