From clipboard or file rename script 4.0

Share useful rename scripts, regular expressions, etc.
gieron
Registered Opus Pro User
Posts: 28
Joined: 16 Nov 2004, 11:05
OS: Windows 10 64-bit
Opus: Directory Opus 12
Location: Sweden
Contact:
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.

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.
Attachments
From Clipboard or File 4.0.zip
(8.99 KiB) Downloaded 113 times

opw62
Registered Opus Pro User
Posts: 981
Joined: 30 Jul 2005, 01:34
OS: Windows 10 64-bit
Opus: Latest Beta
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.

User avatar
Amorax
Registered Opus Pro User
Posts: 86
Joined: 12 Jan 2010, 02:42
OS: Windows 10 64-bit
Opus: Directory Opus 12
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.

opw62
Registered Opus Pro User
Posts: 981
Joined: 30 Jul 2005, 01:34
OS: Windows 10 64-bit
Opus: Latest Beta
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!

=

Image
=

User avatar
Amorax
Registered Opus Pro User
Posts: 86
Joined: 12 Jan 2010, 02:42
OS: Windows 10 64-bit
Opus: Directory Opus 12
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.


Return to “Rename Presets”