Files that are temporarily in use (e.g., still downloading, being written to etc.) cannot be renamed until they are no longer in use (closed).
This button script allows you to specify new names for selected files, and they will be automatically renamed as soon as they are no longer in use, or when they finish downloading.
This button supports two kinds of "busy" files:
- Files that are currently in use (locked) by some program.
- Files which have a ".part" extension while being downloaded (e.g.,
test.mp4.part) -- such files are created by the web browsers, download managers, YouTube download tools etc.
Step 1: for each selected file you'll be asked for a new name.
Step 2: any remaining renames are indicated in a list until they are automatically done.
You can move the file instead of renaming by specifying the destination path instead of a new name.
You can also combine rename and move operations by prepending the destination path (e.g., renaming "test.txt" to "C:\Windows\hello.txt" will combine a move and rename operation).
- The "Pending Renames" dialog must remain open for any pending files to be renamed. Closing it is equivalent to clicking Cancel.
- The script dialogs currently cannot be minimized which may be inconvenient
- Each separate click on the button will create a new instance of the "Pending Rename" dialog.
- When moving, both forward and back slashes are supported and can even be mixed.
- When moving, an absolute path must be specified, relative paths are not supported. Drives letters must have a slash after a colon.
- When moving, and the destination path doesn't exist, the move operation will be in a pending state until the destination path becomes available.
- Quirk: when renaming and the new name is not valid (e.g., contains illegal characters), the operation will remain in a pending state rather than showing the error message. You'll need to click Cancel.
Download this button:
v1.0 (latest) 2023-06-09
Patient Rename.dcf (12.3 KB)
New in this version:
- Fixed a bug where pressing Cancel causes Opus to use lots of CPU due to runaway loop due to not checking an appropriate event object property.
- Implemented ability to move the files.
Not recommended due to a bug causing high Opus CPU usage if the Cancel is clicked or "Pending Rename" dialog closed. Patient Rename.dcf (10.9 KB)
Some extra details on how it works
The script tries to rename the files immediately, and if it fails, it will create a "Pending Rename" dialog with a status list and retry every second. Once a file is renamed it is removed from the list, and once all files are renamed the status dialog closes.
If a file no longer exists, the script will give up on it.
If a file has a ".part" extension, the script will wait until it no longer has a ".part" extension before making a rename attempt.