#1 2023-06-22 02:49

vernonblake
Member
Registered: 2020-11-02
Posts: 1

Create rule from clipboard content

Licensed and satisfied Pro user since 2017!

But I cannot figure out how to create a rule that inserts the current content of clipboard.

Example:

Filename BEFORE renaming:
123_file-example.txt

Last text copied to clipboard:
simple_

Filename AFTER renaming:
123_simple_file-example.txt

Thanks in advance!

Offline

#2 2023-06-22 10:43

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,400

Re: Create rule from clipboard content

At the moment the clipboard content can be accessed only via the Pascal Script rule.

The script below will achieve what you have described, using Regular Repressions for handling the insertion of clipboard content:

begin
  FileName := ReplaceRegEx(
    FileName,                 // Input
    '\A(\d+)_',               // Find
    '$1_' + GetClipboardText, // Replace
    True, True);              // Options
end.

It might be a good idea to implement a meta tag for a more convenient access to the clipboard content via other renaming rules.

Offline

Board footer

Powered by FluxBB