Tuesday, January 5, 2010

Keyboard-based File Renaming

There are subtle differences in how a file navigator handles keyboard-based file manipulation that are easy to overlook. They appear minor or trivial at a glance, but can be detrimental to usability with the sum of all nuisances, or with batch file manipulation tasks by hand.

There is a lot to focus on, so I will keep this one about file renaming.

Renaming in the Early Days

Back in the days up until and including Windows XP, if a user renamed a file (F2 by keyboard shortcut, or by "Rename" via right-click contextual menu), it would highlight the entire file name and its file extension. (This is, of course, unless known file extensions were hidden.)

This was a problem for a couple reasons. If you didn't know what a file extension was, you would likely accidentally rename a file extension. If you did, it was an extra three or four keyboard strokes for each file to place the cursor to the end of the actual file name. It doesn't sound like much, but you pride yourself on using keyboard shortcuts for the purpose of being fast.

Mom and Dad skiing.jpg

Fortunately, some years back, I noticed on Debian and Mac OS X that triggering a file rename highlights the file name only, with the option to move the cursor to the right into the file extension area.

Mom and Dad skiing.jpg

It was a huge improvement, but considering that most of the world was on Windows, it was important that this make it over to the Windows side.

Renaming Today: Cursor Placement

Starting with Windows Vista, this behavior was available in Windows Explorer. The only issue is that if you rename (F2 or by mouse) to highlight the file name only, and realize you want to append or delete characters from the end of the file name, you hit the right-arrow instinctively. That should place the cursor at the end of the name and before the dot of the file extension, right? This is the case in Linux and OS X, but not so in Vista or 7.

Before:
Mom and Dad skiing.jpg

After (Linux, OS X): Right-arrow places cursor before the dot:
Mom and Dad skiing|.jpg

After (Windows Vista, 7): Right-arrow places cursor after the dot:
Mom and Dad skiing.|jpg

What are the implications in this difference in behavior? Let's compare this to the way you would normally rename a file with the file extension hidden.

Before:
Mom and Dad skiing

After (All OS's): Right-arrow places cursor at the end of the file name:
Mom and Dad skiing|
Mom and Dad skiin|
Mom and Dad skii|

Without file extensions, the keys are F2, arrow-right, and then delete or append right away, in the case of Windows. So if we apply this with the incorrect behavior of placing the cursor right of the dot, we get this.

Before:
Mom and Dad skiing.jpg

After (All OS's): Right-arrow places cursor at the end of the file name:
Mom and Dad skiing.|jpg
Mom and Dad skiing|jpg
Mom and Dad skiin|jpg
Mom and Dad skii|jpg

Screenshots after the break (note the text cursor placement):

Renaming Today: Cursor Jumps

What if I want to jump the text cursor to the beginning of the name? In OS X, hitting the "up" and "down" keys moves the cursor to the start and end of the file name, respectively. In Windows, it simply doesn't register at all, so there's some further improvement that could be made there.

DOWN ARROW ↓: Mom and Dad skiing|
UP ARROW ↑: |Mom and Dad skiing

Renaming Today: Shift-Selection

If there's anything everyone seems to have implemented, it's holding the "shift" key as you add or subtract characters from a selection of text.

Mom and Dad ski|ing.jpg

Batch Renaming

Unless you know what regular expressions are, batch renaming options leave a bit to be desired. On the one hand, you have nothing really built into OS X in Finder, and leaves this work to AppleScript in the form of a handful of pre-written automator scripts. On the other hand, Windows does provide a basic sequential batch renaming solution by appending numbers in parenthesis to an otherwise identical base name. This was available since Windows XP.

Ski trip.jpg
Ski trip (1).jpg
Ski trip (2).jpg
Ski trip (3).jpg

Otherwise, not much interesting is going on in the built-in UI file navigators.

Improvement and Progress

But OS parity aside, honestly, there have been some interesting solutions in third party file renamers such as batch renamer utilities. It pains me that there have been so few improvements implemented into the UI side for this tedious task. It could be something a little more inventive like predictive text entry or something as simple as the live spell check that exists everywhere else. It's all in the details, folks.

No comments: