Command: RenameFromClipboard

After reading this for several times, it seems to me as if you're better of doing it with a separate script or something. I actually don't get where the list of random file names comes from. Could that be generated maybe, is it even necessary? Additionally, I don't get how you determine the number of files to copy from that list. And then, how do you do the required selection in the file display to finally run RFC? Maybe a separate short snippet, which runs upfront to read the file and copy some items from there to the clip is a start/an option.

That said, I think I won't add support for input from files here. This command is deprecated, there is RenameEx (did not upload recent version it seems or still need to merge what I have prepared here, oops! o). Additionally, I thought about a method to streamline script in/output of items, because the "source" question comes up again and again. You want items from file, the next buddy from destination display, someone else likes to pass items by commandline and for me, I might prefer to pass item names by a DO vector for increased script interoperability. So, instead of adding support for the various in/output buckets each time - implemented differently in the worst case (parameter names e.g.), it seems there should be an universal approach, which can be put in place and "done". Making requests like this the past. I've started on that thing already and use it in a script addin not published yet (TFS source control). It's a matter of time (or big money! o), when things will enhance and move on from there into other script commands.

Does this make sense to you? Thanks! o)


Note that the randomfile list is already available. A simple .txt file with many random names.
As said, right now I open that list and clipboard copy a part of the list, which I hope will be sufficient, and then use RenameFromClipboard.

My idea was to use data from a list, instead of from clipboard, so the 'steps' of opening/clipboard copy would not be necessary anymore.

Just an idea though.

I just discovered there is something similar to what I suggested: 'From file rename script version 3.1' (from gieron).

Gave it a try.
Drawbacks (for me, that is):
-the 'source' filelist with random names should always be placed in the folder with the files to be renamed first
(so it requires me to first find the file with random names and then copy it to the respective folder - i.e. browsing thru folders,
click, click.. it would be better to have the file list in the Opus directory by default)

-it does not support files that are displayed when using Set FLATVIEW=Toggle,MixedNoFolders

Anyway, forget it, as said, just an idea... :wink:

hi tbone. I am using this script very regularly.
many thanks.

I wonder, would there be a way (a new script maybe?) to extend the features so it will randomize the modified date based on clipboard?

say I have in clipboard data like
1937-04-07 12:21:27
2012-08-28 21:47:51
1988-11-09 04:07:32
1932-04-05 00:43:20
1963-09-28 12:30:28

then the existing modified date changed accordingly.


Sounds like a very specific and (odd? o) usecase but why not. It's not related to renaming things, so something like this won't make it into this addin or its followup (which I need to upload someday). Cannot remember your scripting capabilities, but modifying this one to do what you imagine shouldn't be too hard.

Indeed, very specific, long story and not really interesting for others.
Just now found a workaround though, 3rd party software.
So forget it.
btw: my scripting capabilities are nil... :slight_smile:


Just a very minor tip tbone, the latest is 0.3, on the 1st page 0.2.2 is said to be the latest. The one listed above 'latest' is actually indeed the latest, i.e. v0.3.


Thank you! Fixed immediately! o)

My button doesn't work anymore :confused:
When I use the button it tries to remove the file name and only leave the ".{ext}" and stops after the first file because it's trying to make a file with the same name.

This button used to work fine. I am using v0.3.

%item.new_name_stem% seems to be the problem, but I don't know the script well enough to say why it would have worked before but isn't now:

			commandTmp = commandTmp.replace("%item.new_name%",newItem.filepart);
			commandTmp = commandTmp.replace("%item.new_name_stem%",(""+newItem.filepart).getBaseName());
			commandTmp = commandTmp.replace("%item.new_path%",newItem.pathpart);

You can avoid that problem by using %item.new_name% instead, and adding IGNOREEXT to tell Opus to preserve the file extension instead of the script having to do it:

(The old FILEINFO switch was also removed as it isn't needed in Opus 12 or above.)

RenameFromClipboard COMMANDS Rename IGNOREEXT FROM="%item.realpath%" TO="%item.new_name%"

That works OK from my own quick test.

Also, this kind of multi-line/file clipboard support is built into the Rename dialog these days, if that's easier:

Thank you :smiley:
It's good to know that is built in as well.. I have avoided using the built in rename thing in the past because Bulk Rename Utility usually does what I want and I don't know how to script.

Please go with Leos suggestions or add actual file extensions to your file names in the clipboard, I think that's the cause of the problem. Not saying that there isn't something to be fixed here. o)

I'm not 100% sure now that that was the same button.. My C drive died recently and I stupidly had the configuration backup on the same drive. If that command does only work if the extensions are there that could make sense. Currently I'm copying folder names and putting them on files.. It's possible I only used that button when I was copying names from one set of files to another before. So there might not be anything to fix but I don't know.
I do think it was the same button though because I think it came with the theme (or whatever it's called) I'm using.

Updated to v0.3.1

I fixed the problem with filenames in clipboard having no extension and uploaded a new version.
Maybe try again. o)

1 Like

small tip only... maybe also change : data.version = "0.3" ?
keep up the good work.

Yep, I obviously missed that, but to my defense, I updated and wrote the correct version at 3 other locations at least! o) Now updated inner-script as well, thank you! o)

Is anyone having trouble with this script? It doesn't work for me anymore. When I select a batch of files and run RenameFromClipboard, it opens the rename window with only the first of the selected files and doesn't bring the clipboard names in.

Confirmed. Created a new topic, since it seems DO had an internal change.
We will find out what to fix, DO or the script addin. o)

I have a file name in my clipboard which have a number

MyFileName (12)

I want to rename the selected files as it is in the clipboard but just Increase the number +1
the wanted file name is

MyFileName (13)

thanks for your time on this and sharing it. should prove useful for some work related applications

Deselect parameter does not work.
Quiet parameter works but only if you set it globally (in Prefs > Toolbars > Scripts > Configure).

Still -- thanks for the great tool!