From Clipboard or File v4.0

Replaced by From Clipboard or File v4.1


This version works only in Directory Opus 12 and above.

If you have Directory Opus 11 or below use From file rename script 3.1 instead.

Also note that Opus 12's Rename dialog has built-in support for renaming files from the clipboard:

200dpi_wc10309_dopus


These rename presets take lines from clipboard or a text file and use them as new filenames or as part of new filenames.

Script information
From clipboard or file rename script version 4.0 (tested with Directory Opus 12.1 x64)
by Henrik Ripa (henrik@gieron.info) 2016-09-11

Changelog for version 4.0

  • The settings are now accessible from the rename dialog
  • Whether to use the clipboard or a file is now a setting instead of the old way of falling back to file if there was nothing in the clipboard
  • There are now two rename presets, one for clipboard and one for file

Installation
Download and unzip the .orp files.

Open the Directory Opus rename dialog. Select Import Preset File from the Preset Management menu and open 'From Clipboard.orp'. Close the Directory Opus rename dialog.

Open the Directory Opus rename dialog. Select Import Preset File from the Preset Management menu and open 'From File.orp'. Close the Directory Opus rename dialog.

Instructions
This script replaces the string 'MARKER' in new file names with lines taken from the clipboard or from a text file. If the lines include any characters that are illegal in filenames they will be removed.

If a text file is used it must be located in the same directory as the files that you want to rename.

When the text file is in place, or you have copied some text to the clipboard, select the files you want to rename. The order of the selected files in the lister must be the same as the order in the text file. Then click the rename button and select this script under presets.

Set up the old name and new name fields so that the the string 'MARKER' is present in the new file names. You can use standard rename, regular expressions or find and replace. Inspect the results in the preview pane and click OK.

If you have problems you can start by examining the script output below the editor. If you find a bug or have a feature request you can either go to the Dopus Resource Centre forum thread where you got this script from or send me an email.
From Clipboard or File 4.0.zip (8.99 KB)

2 Likes

Fantastic!

Have to confess, with Opus v12.3.3 I was still using the 'From file rename script 3.1'.
That one worked fine... Wasn't aware of a newer version until I needed to rename files whilst using existing names combined with clipboard.
Wasn't sure how to do that with v3.1 (if at all possible) and noticed a newer version was out.

Many thanks indeed, it works perfectly.

=
p.s. what is the difference between the From Clipboard.orp and From File.orp
when selecting 'Get filenames from"' pulldown and select 'Clipboard' they look the same.

Thanks for version 4.0.

@opw62: From clipboard uses the clipboard contents. So you can copy the filenames from some place and use them directly without pasting them first in a file.

Probably I am overlooking something.
For me they look very much the same and when selecting 'Clipboard' in the drop down menu (at: Get filenames from) they act the same.

BUT.. that is a minor thing.

It is a great tool, that's for sure!

=

Ah, I see what you mean. I thought the difference was the default option for the dropdown 'Get filenames from'. So when you double click the 'From file' preset |File is selected in the dropdown and for 'From Clipboard' the option |Clipboard. But that's not the case; both times it's Clipboard.
BTW. Looking at the scripts I see that lines 2, 413 and 415 are different.

@Giero:

  1. Can you make the dropdown chooses File when I double click the 'From File' preset?
  2. Can you fill in the field 'File to get filenames from' with a default value 'filenames.txt.

It saves mouse clicks and typing when using the 'From file' preset.

Sorry for not answering this sooner.

The two presets are definitely intended to work in the way Amorax describes. The default values for the dropdown and 'File' field is also the only difference between them. The script is exactly the same for both.

There was a bug in earlier Opus versions where it didn't update the custom fields when switching between presets. But that should be fixed now. Let me know if there is still an issue with this.

A little question, hope sombody read this after 6 years. I have to replace the names of 2 ore more filenames from clipboard with different extensions at once. I made a button with the "From clipboard" preset. When I mark two files in the lister and hit that button only the first name is changed. How to do it for all files at once (they have different extensions). Thanks in advance.

Try checking Rename matching filenames as one.

Sadly this doesnt work here. With " Rename matching filenames as one" checked only the first file is renamed, also when I use the built in "From clipboard" command in the rename window.

Odd. Seems to work here.

Ha, today I tried it once more in a lister without changing anything before, but now it works! Thank you for your hints!

@gieron I would like to make 2 suggestions:

  1. Using v4.0 with Opus 12.33 x64: when double clicking the "From File" preset, it opens using Clipboard by default. Could that be changed to using "File" ?
  2. The "filenames.txt" should be copied over to the folder that should be renamed.It would be nice to allow the filenames.txt alongside the .orp files (usually in Opus folder)/
    If, for example, you wish to rename various folders and files on different partitions using random file names, you would need to copy filenames.txt folder each time.
    Or folders and sub folders and files on drive 1 but just the files on on drive 2, you have to copy the file each time.
    So, 1 central place would be nice.

SnagIt-03012024 074605

It was the intention that the dropdown should be set to File if the "From File" preset was used, but it seems it never worked properly. I have updated the script to 4.1 where I removed the dropdown altogether so the presets work like intended.

For your second suggestion I made an update to the 4.1 version so that the filename can now take an absolute path. So in your case, put the file wherever you want then put in the full pathname of the file as shown below. If you save this as a preset it will always use that file.

image

Super!
Thank you very much indeed.
As for the 2nd thing matter (filenames.txt), just for good order's sake: is it correct that one has to select and copy/paste the full path name?
Drag & Drop filesnames.txt located in some other folder - not sure it works as intended. Or maybe I am doing something wrong. Could very well be ... :slight_smile:

(Using v13.1 x64)

It's just a simple text box, so it won't have fancy features like drag & drop of filenames. Copy/paste the full path name is the way to go.

Okay, clear. No problem, of course.
Thanks again.