I think the best way to do this is with the Templater plug-in. Here’s one of a few threads here talking about this.