Batch rename with action list

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, helmut, xnview

Post Reply
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Batch rename with action list

Post by helmut »

budz45's ideas in in topic Ideas for 'Batch rename' made me think and brought an idea to my mind:
budz45 wrote:.. Perhaps in a future XnView MP you could consider adding a second or even third 'replace' function (so 3 in total) with perhaps the 2 extra hidden by default for a user to press to show them and use them. I've seen 2x replace functions in ShellToys 'batch rename' tool. ...
Action list in batch processing
Batch processing works like this: You add actions from the palette of all available actions to your action list. For each action you set the action's parameter as desired to specify in detail what the action should do. This approach is very flexible and allows arbitrary combinations of the actions, including the application of the same action multiple times.

Action list in batch renaming?!
Perhaps batch renaming could work the same way: You have actions like Replace, Upper, Lower, and whatever, and you add them to an action list for renaming. Adding "Replace" two, three, or <n> times would no longer be a problem, then.

Functions that might be needed:
Add - for adding text to the existing text. Parameter: Fixed text and/or place holders
AddEnum - for adding an enumeration. Parameter: Enumeration type (Image, Page, Image in Directory, ...,) Start value. Step value.
Replace - for replacing a character or word with another character or word. Parameters: Search string, replace with string
Lower - for lowercasing the current text. Parameters: none
Upper - for uppercasing the current text. Parameters: none
Trim - for trimming leading and trailing spaces. Parameters: none
AddSub - for adding a substring of a text to the existing text. Parameters: start index. end index (optional)

Hmm, perhaps two action lists will be needed: One action list for the filename and one action list for the extension. Typically, the action list for extension contains {extension}, only.

An action list for renaming might look like this:
Add "MyImage_"
AddSub {filename}, 2
Add "_small"

The above action list would convert "P238238" to "MyImage_238238_small" for example.

This is what such an action list for batch rename might look like:
XnC - Action list 01.png
XnC - Action list 01.png (59.04 KiB) Viewed 4199 times
Notes for the above draft:
- Example shows XnConvert, but the same would apply for XnView MP
- Preview of batch processing is placed to the right, but lacking of space preview of batch rename was moved to the bottom of the dialog.
- An empty action list means 'No action' / 'No change', no need to add action 'Add {filename}' explicitedly.


With the right functions and parameters available, this approach would make batch renaming really flexible. And using and offering the same user interface approach for batch processing and batch renaming is quite appealing. I'm not sure whether this concept is easy enough to pickup, though. What do people think about this approach?
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Batch rename with action list

Post by helmut »

No comments/opinions? Looks as if my above suggestion is too overwhelming and fantastic. ;-)
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Batch rename with action list

Post by marsh »

I like this idea of one function teaching the other. Both transformations and renaming.
If someone can pick up on current filename template button ">", then why not this?
It looks more modern than v.1.x style dialog. Drag and drop ready.
User avatar
JohnFredC
XnThusiast
Posts: 2010
Joined: Wed Mar 17, 2004 8:33 pm
Location: Sarasota Florida

Re: Batch rename with action list

Post by JohnFredC »

Hi Helmut

I like this idea quite a bit!

It would be good to be able to click on each action and see the cumulative preview of the filenames up to that point. The user could then observe the progression of names that would occur when the script executes. This could be an important tool to resolve the occasional conflicts that can arise.
John
User avatar
budz45
XnThusiast
Posts: 1621
Joined: Sun Jun 03, 2007 6:05 pm
Location: UK

Re: Batch rename with action list

Post by budz45 »

Yes, I think this is a good proposal from the perspective of desiring to add multiple of the same actions in a single renaming session for example. adding multiple 'replace' in an 'Actions' list.

My only concern is that GUI for 'Actions' doesn't seem straightforward enough for the quick on-the-fly user who may just want a simplified-visual renaming experience in XnView MP.

Therefor this 'Actions' list could be better located in an 'Advanced' area, IMO. The 'Advanced' area could also further support all/any other advanced renaming actions like 'Wildcards' support, numeric Enumeration and also renaming of audio or video files based on Tag metadata. This would mean that some of the things found in the current Batch Rename of XnView MP could be moved over to this 'Advanced' area too.

So two tabs could possibly exist, a "Basic rename" tab and a "Advanced rename" tab both under an XnConvert 'rename' tab:
basic_n_advanced-rename.png
basic_n_advanced-rename.png (54.76 KiB) Viewed 4111 times
  • Both tabs would use the same file list area when switching between tabs before a rename.
  • Both tabs can't be used at the same time - so one tab would get greyed out if one is already in use.
  • The use of really wide tabs on the GUI for best distinction as sub-tabs/sub-heading tabs
  • The "Basic rename" tab would just continue using the present renaming GUI found in current XnView MP 'Batch Rename' with some minor tweaks :)
  • The "Advanced rename" would present all functions within an 'Actions' list. It would have all the features of "Basic rename" + plus more.
This is how it could possibly look like in MP's Batch Rename;
brnmp-mock1.png
brnmp-mock1.png (70.83 KiB) Viewed 4111 times
Just a thought :wink:
All My Topics || my 'MP' Topics
My own Bookmarked topics--->for me only
marsh
XnThusiast
Posts: 2443
Joined: Sun May 15, 2005 6:31 am

Re: Batch rename with action list

Post by marsh »

First actions could be permanent. Such as a fixed item for case.
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Batch rename with action list

Post by helmut »

Thank you, John, marsh, and budz for your feedback, it's much appreciated. :-) Below please find some comments.
marsh wrote:I like this idea of one function teaching the other. Both transformations and renaming.
If someone can pick up on current filename template button ">", then why not this?
It looks more modern than v.1.x style dialog. Drag and drop ready.
Yes, same user interface concept for both transformations and renaming - should make it easy to pick up.
JohnFredC wrote:I like this idea quite a bit!

It would be good to be able to click on each action and see the cumulative preview of the filenames up to that point. The user could then observe the progression of names that would occur when the script executes. This could be an important tool to resolve the occasional conflicts that can arise.
Good idea, such a preview might be handy for debugging. From my point of view the actions are not very complicated, the user should see the preview of all actions by default. There should be an option or action that switches the preview up to the selected action on/off.
Perhaps the same UI concept for switching can be used for both batch processing and batch renaming.
budz45 wrote:... My only concern is that GUI for 'Actions' doesn't seem straightforward enough for the quick on-the-fly user who may just want a simplified-visual renaming experience in XnView MP. ...
That's also my concern and offering two GUIs like in your nice draft might help. But I don't like offering two GUIs for the same thing.
marsh wrote:First actions could be permanent. Such as a fixed item for case.
Making first action permanent is an approach. But the idea is to have an empty action list if no action is desired. (After combining batch transformations and batch renaming an empty action list makes sense, before it did not make much sense unless you wanted to perform a format conversion, only).

Good default and focus when opening dialog
Perhaps the behaviour could depend in the way you call/start this dialog:

A. When using 'Batch rename" or "Batch processing" and no files are selected in browser, the dialog "Batch processing" should open with...
... tab 'Input' opened/focused

B. When using "Batch rename" menu item, the dialog "Batch processing" could open up with...
... the tab 'Batch rename' opened/focused
... one action 'Add' in the action list
... focus on field 'Text'.
... field 'Text' filled with a sensible default (e.g. <filename>)
This way the user can work on the filename template immediately.

C. When using "Batch processing" menu item, the dialog "Batch processing" could open up with...
... tab 'Conversions' opened/focused
... focus on empty action list.
User avatar
xnview
Author of XnView
Posts: 43442
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Batch rename with action list

Post by xnview »

If i understand correctly you would like to have an advanced output naming, right?
It's not too complicated for users??
With RegExp replace, we can already do advanced renaming...
Pierre.
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Batch rename with action list

Post by helmut »

xnview wrote:If i understand correctly you would like to have an advanced output naming, right?
It's a full batch renaming and would replace the existing batch renaming. Batch conversion and batch renaming would be combined (which is partly the case, already). The new thing in this suggestions is the user interface: Instead of a dialog full of things (template, extension, replace, ...) you have actions and can specify an action list.
xnview wrote:It's not too complicated for users??
That's the point I'm not 100% sure, this has to be verified, e.g. by posing questions and trying out various conversion tasks. In my draft above, I have used a batch rename that is advanced and with current renaming not possible. A simple and typical rename would look like this:
XnC - Action list - Simple 02.png
XnC - Action list - Simple 02.png (58.24 KiB) Viewed 4031 times
Looks pretty clean and simple, I think. Various things needs to be considered and examined, e.g. which actions can be applied to the extension? Just Lower and Upper?
xnview wrote:With RegExp replace, we can already do advanced renaming...
In which XnView version is RegExp replace supported? Do people know about this (I didn't)? Personally I don't think that regular expressions are easy to use, but there are good tutorials.
Post Reply