Rename file and keep selected

A common task I perform is right-clicking and creating a new text document. I then rename this file (instead of the near-useless "New Text Document.txt") to something else by clicking on the file, entering the new name, and pressing enter.

At this point it would be nice if the file was still selected so that I could then press enter again to load it into my text editor. Currently it deselects it so I have to click on it again.

Thanks!

Well, I was going to reply with a suggestion that you create a new context menu option that ran something like:

dopusrt /cmd FileType NEW=.txt NEWNAME="{Rs}"

I would have thought that since the name is being specified by the NEWNAME argument that Opus would NOT create the file with the prefix highlighted for inline rename, and possibly leave the file selected... Alas, not the case. Does anyone know if there's a way to prevent Dopus from defaulting to inline rename on a newly created file using the NEWNAME arg WITH a name being specified?

edit note- I know the norename switch was added to accept the auto-generated name while inhibiting the inline rename... But I think GPSoft should consider changing the default behaviour to 'norename' when you're actually providing the name with the NEWNAME arg. Or maybe just allow something like:

dopusrt /cmd FileType NEW=.txt NEWNAME="{Rs}"|norename

For now, you can hit the spacebar to reselect the file after you name it and hit enter, then hit enter again to open it. It's not perfect, but it should keep your hand away from the mouse :slight_smile:.

Thanks Steje.

Unfortunately I can't hit space to reselect the file as I use the "Automatically sort new and modified files" option.

Wouldn't it be better to make a button which launches your text editor in the directory you're interested in? Then you can type into a new file and press Ctrl-S and name the file whatever you want.

Nudel probably has the right idea for the 'least clicking involved' type of solution... I see what you mean about the file sorting. Sorry about that, I steered you wrong. I had been quick testing by accepting the default New Text Document.txt name and not actually renaming it.

I think the 'feature request' is valid for other reasons though. It would be nice if the NEWNAME=norename functionality were used as the deault when specifying the files actual new name in the argument as well - and only switch to inline rename if the file name specified in the argument already exists.

I need to chime my support in here as this is one of those things that bothers me about Opus. After renaming a file, it unselects it so if I now want to do something with it I have to click it again to then select it. Windows Explorer keeps it selected.

I have another problem with selecting but I'll post that elsewhere.
Jeff

Hmmm... if you're just talking about renaming an existing file (as opposed to the specific new->new text document thing we started out discussing here) then you might be able to fix your problem with some prefs settings? If I rename an existing file in a lister by hitting which runs the rename inline function, then the file remains highlighted... even if it changes sort position in the file display.

This is by design. Otherwise you would have to deselect files all the time and the next command could accidentally operate on files you did not intend.

Use the Reselect command to reselect the files from the last operation. By default this is available on the right-click of the Select button on the toolbar. Also check you usage of Preferences - File Operations - General ->Postpone file deselection until end of function

That option didn't do anything differently. The solution I guess is to do the reselect everytime. I hardly use the toolbar buttons but I guess I better get in the habit to as there are some handy things there.

Well probably not... again, if you're just talking about renaming an existing file then there must be some combination of settings to make it work like you want because hitting the key to rename an existing file leaves the file highlighted/selected for me after the rename.

I am talking about hitting F2 to rename an existing file. I do the rename and hit Enter to save it and the filename is highlighted with the dashed border but a true select where it is all black. Now if yours after hitting Enter is remaining black, then there must be a setting somewhere.

Is the file selected before you hit F2 to rename it?

Inline rename won't select a file but it should not deselect a file either.

If you want F2 to select the file and then rename it you might need a feature request as I can't see how to make the select command select the file with the input focus (dashed rectangle) in the current version.

I feel like a friggin parrot LOL - copy and paste is a wonderful thing. Yes, hitting the key to rename an existing file leaves the file highlighted/selected for me after the rename... even if it changes sort position in the file display.

What this means is if I select a file named a.txt with my mouse and hit to rename it to z.txt; after I hit to 'accept' the rename, the file will move to the bottom of the file display and retain selection - fully highlighted and NOT just the dashed rectangle. Whatever the 'next' file was after the original a.txt filename get's the dashed rectangle... So if I immediately hit again after renaming the file, z.txt opens up in notepad...

I'm curious, what view mode are you in - details, power, list, etc? If you're in details mode, do you the have the Full-row selection option enabled?

There is also the issue with the rename dialog when you want to do multiple renames, for example:

  1. Select a bunch of files
  2. Hit rename to bring up the dialog
  3. Find/replace some text
  4. Hit OK

Your files have been renamed but the selection is gone, so you have to hunt around re-selecting them if you want to do more name tweaking.

Hence my feature request [Rename dialog enhancement)

Just press the Reselect button or add @NODESELECT to the last line of the Rename button.

[quote="steje"]What this means is if I select a file named a.txt with my mouse and hit to rename it to z.txt; after I hit to 'accept' the rename, the file will move to the bottom of the file display and retain selection - fully highlighted and NOT just the dashed rectangle. Whatever the 'next' file was after the original a.txt filename get's the dashed rectangle... So if I immediately hit again after renaming the file, z.txt opens up in notepad...

I'm curious, what view mode are you in - details, power, list, etc? If you're in details mode, do you the have the Full-row selection option enabled?[/quote]
I followed your steps exactly (which is what I was doing anyway) and mine does everything the same EXCEPT keeping the selection on z.txt. That file is left sitting by its lonesome with no selection of any kind. What happens in your case is what I am trying to figure out how to make mine do.

I am in Details mode. I tried Power mode but that doesn't even leave the dashed rectangle. And I didn't have the Details Full-row selection on but it doesn't make a difference if it is or not.

There has to be some difference in the settings that is making it work for you and not for me.

What about Preferences / File Operations / General / Postpone file deselection until end of function? If I turn this off, I get the behaviour you describe. With this option enabled, it behaves as steje says.

That's it! "Postpone file deselection until end of function" does do the job. I knew it had to be a setting somewhere. Thanks to everybody!

COOL! Jon da man...