Hello. I wish to have the following steps done to help me rename files/folders in a specific way:
Example text from clipboard to be fetched: This is a Christmas gift
Output I wanted when renaming a file/folder: 20230210_This_is_a_Christmas_gift
-where the date is the date today
-where all spaces are converted to underscores "_"
-where the text case is not affected
-where the spaces at the end of the clipboard (assuming the text in the clipboard has extra spaces after the word "gift") are removed
Thank you!
PS: does this fall under 'Rename' or 'Run Script'?
script request to quickly rename file with date
-
highend
- Posts: 14923
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: script request to quickly rename file with date
renameitem(formatdate(, "yyyymmdd") . "_" . replace(trim(<clp>), " ", "_"));One of my scripts helped you out? Please donate via Paypal
-
bebotette
- Posts: 4
- Joined: 01 Apr 2022 04:29
Re: script request to quickly rename file with date
Thanks. Please tell me if I did the right steps because I'm getting an error (attached):
1. Went to User > Managed User-Defined Commands
2. Under category, I clicked 'Run Script'
3. Added a new command, then on the script field, I pasted the one you provided.
Now when I click on a file and trigger this command, I get some error. Please help.
1. Went to User > Managed User-Defined Commands
2. Under category, I clicked 'Run Script'
3. Added a new command, then on the script field, I pasted the one you provided.
Now when I click on a file and trigger this command, I get some error. Please help.
You do not have the required permissions to view the files attached to this post.
-
highend
- Posts: 14923
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: script request to quickly rename file with date
Show the button definition with the script part visible...
One of my scripts helped you out? Please donate via Paypal
-
jupe
- Posts: 3446
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
Re: script request to quickly rename file with date
It seems like you are running the script with the script still on the clipboard.
-
bebotette
- Posts: 4
- Joined: 01 Apr 2022 04:29
Re: script request to quickly rename file with date
Thanks for all your input. It took me some tries to finally get the hang of it.
Thanks a lot! It works!
Thanks a lot! It works!
XYplorer Beta Club