I would like to have a button that allows me to type inline at a specific position

I would like ot have a button (+hotkey) that allows me to type directly into a filename (inline or alternatively in the opened advanced rename dialogue) at a specific position.

Explanation: My scanner scans files with a date 2024.04.14 - 001.pdf

I want to have a button that will in a first step replace the "001" (that ensures unique naming and avoids naming conflics until I have renamed the file) and then positions the cursor for inline editing after the '-" at the 12th position counting from the beginning of the filename. It is always the same position in my naming system.

Is this possible?

If I have the macro or command or script I know how to create a button.

Thank you very much in advance for helping!

Try this button

@nodeselect
Rename_PATTERN
Rename_INLINE

with these user commands:

@nodeselect
Rename PATTERN="(.* - )\d+" TO="\1" REGEXP IGNOREEXT
@nodeselect
Rename INLINE=endstem

Make sure to select only one file when running the button.


Or get Opus 13 and use this Rename Key:

newStem = RegEx(valstem, "(.* - )\d+", "\1");
selstart = len(newStem);
selend = len(valstem);
XML
<?xml version="1.0"?>
<regexsel key="f3">
	<eval>newStem = RegEx(valstem, &quot;(.* - )\d+&quot;, &quot;\1&quot;);
selstart = len(newStem);
selend = len(valstem);</eval>
</regexsel>

Thank you very much for helping me!

I got Opus 13 Pro, but the Rename Key gives an error.

As a first step, please be so kind and explain where I have to insert this code and to which type I have to set the editor. I have a button and I have inserted the three lines into the command editor script section.

Paste the XML code here:

Start the inline rename with F2, then hit F3. The digits will be selected and ready to be overwritten.

Thanks again.

When I press F2 to start Inline renaming and then press F3 then nothing happens.

Maybe we can start very simple: just have the inline cursor jump to a fixed digit (for example the 12th).

Can you show us a screenshot of how you have the F3 key configured in the Preferences page Lxp showed above?

Looks okay and should work fine.

I finally got it working.

a) So how can I change the behaviour in such a way that nothing is selected and thus overwritten, just the cursor positioned after the "-" like an "insert" mode?

b) and how can I set the inline editing cursor to a "hard" position, like the 9th, for example?

Set selstart and selend to

a) len(newStem)
b) 9