#1 2020-11-15 06:52

Decoboy
Member
Registered: 2020-11-15
Posts: 2

Ask user for text to be used in insert, remove, replace actions

Long time user - first forum post - great product.

Is there a way to prompt the user for insert, remove or replace text that will be used for all (selected) files?
That way the same preset can be used without having to edit the text each time

e.g. I have a simple rename and serialize preset that:
- deletes the name (skipping extension)
- inserts new name
- adds a dash
- serializes as a suffix

I searched the forum but could not find this.

Offline

#2 2020-11-15 14:30

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

Re: Ask user for text to be used in insert, remove, replace actions

A dialog prompting user to provide some input can be shown in the Pascal Script rule.

For example, the script below will ask the user for a file name (without extension) which will be applied to all files, replacing the original name but keeping the original file extension.

var
  Initialized: Boolean;
  NewName: WideString;
begin
  if not Initialized then
  begin
    Initialized := True;
    NewName := WideInputBox('New name', 'Enter the new file name:', '');
  end;
  FileName := NewName + WideExtractFileExt(FileName);
end.

Note that the prompt will be shown every time the Preview operation is performed, e.g. when you change rules or add files.

In my opinion, it would be more convenient and less error prone to just quickly edit one rule.

Offline

#3 2020-11-16 05:16

Decoboy
Member
Registered: 2020-11-15
Posts: 2

Re: Ask user for text to be used in insert, remove, replace actions

Thank you for your rapid response - this works beutifully.

Whilst changing one rule was certainly simple, for me this makes it very streamlined.
I receive lots of images send to me, from different people, often with long names, and all I need to do is change them to a short prefix plus serialize #.

Offline

Board footer

Powered by FluxBB