GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Command: RenameFromClipboard

commands
jscript
scripting

#41

Thanks!

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:


#42

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.

thanks!


#43

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.


#44

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:

=


#45

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.

=


#46

Thank you! Fixed immediately! o)


#47

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.

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


#48

%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:


#49

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.


#50

@Twilight
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)


#51

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.


#52

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)


#53

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


#54

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)