-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NewPlus supports using variables such as yyyyMMdd in template folder names or file names #35332
Comments
This would be great. No clue if it's possible but providing some functionality that parallels the regex replacement rules we already use in PowerRename would also be great. Obviously a very naive example but something like:
Where applying the above is decided based on rules like: If Path Matches Pattern = Then using a NewPlus to apply a folder template in the directory
would result in a new folder called |
Really like these ideas, thank you for sharing. I've started working on some variable support (date and time related, environment variables, and the parent folder name), and hope to release those in a future update. See also #35287 (comment) I'm not sure how to enter a partial rename mode, if anyone has pointers please share. |
Great point, that would work! I might add something along those lines later on, after getting a couple of other things done. Thank you again! |
Description of the new feature / enhancement
NewPlus supports using template strings such as yyyyMMdd (represent the current date) in template folder names or file names.
For example, in “%LocalAppData%\Microsoft\PowerToys\NewPlus\Templates” there are the following folders:
When I used the first template on 2024-10-10, it generated:
And when I used the second template inside the "Work" folder, it generated:
In addition, it should be possible to use specific variables to specify the part of the file name that needs to be modified after creating a new file. Usually, after creating a new file, it will switch to the rename file state and select the entire file name in the rename text box, as shown below.
But most of the time, only specific parts need to be modified. For example, creating a template folder with variables above to get "20241010: Title", user only need to change the last word "Title" to the name of a specific item.
So I want to be able to use a tag like # to specify the part of the file name that actually needs to be modified, to change the cursor/selection behavior when automatically renaming after creating the file.
The resulting template folder name may look like this:
Scenario when this would be used?
This method can expand the flexibility of the NewPlus module and reduce a large number of renaming operations. It does not introduce too many complex operations, and only requires changing the file name of the template file.
Supporting information
no
The text was updated successfully, but these errors were encountered: