Rename From Clipboard Or File <jscript version>

This is a rewritten version.

Base on Henrik Ripa'vbs version:
https://resource.dopus.com/t/from-clipboard-or-file-v4-1/48713

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

Changes:

● Adjusted some custom field options.
● Added a new option: If only one line of text is obtained, apply it to all selected files.
● Auto-detect the encoding of text file, using DOpusScriptingExtensions.UCharDet

Command for using in buttons:

● From clipboard: (you can copy files or text to clipboard.)

Rename PRESET="From Clipboard Or File"

● From text file:

Rename PRESET="From Clipboard Or File" SCRIPTARG skipEmptyLine:false useClip:false file:"C:\test.txt"

Usage

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

Download

2025.7.28 : From Clipboard Or File.orp (17.0 KB)

@bytim

Using this command in a button:

Rename PRESET="From Clipboard Or File" SCRIPTARG skipEmptyLine:false useClip:false file:"C:\test.txt"

I receive the following error:

26-03-02 13:00 Script started successfully
26-03-02 13:00 不存在COM对象:DOpusScriptingExtensions.UCharDet
26-03-02 13:00 Error at line 215, position 6
26-03-02 13:00 Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. (0x800a0bb9)
26-03-02 13:00 Script error - script aborted

Do you have any ideas why? TIA.

It seems like you should install this first.

1 Like

@bytim

This did the trick. Thank you. The current release, 21.0, can be downloaded from Releases · PolarGoose/DOpus-Scripting-Extensions · GitHub