Recursive directory rename

I am trying to recursively rename only folders. When I use the following commands:

Select TYPE=dirs PATTERN *
Rename TYPE=dirs REGEXP PATTERN (.*) TO "{dlgstring} - \1"

The folders in the directory from which I execute the commands do not get renamed and files in all of the subdirectories are renamed, but not the sub-folders.

What am I doing wrong?

Thanks,

Dave

I'm not sure what you're doing wrong. I just copied/pasted your code into a test button and it worked fine for me on the folders I could see in my lister pane. What do you mean by recursive folder renaming? Are you in flat view before you run the command? Or are you trying to recursively rename subfolders another way? (Your button code worked fine for me in flat view)

Maybe it would help if you posted a screenshot, and of course I'm assuming you're using the current version of Opus.

Sorry, I had pasted in the one that is none recursive. Here is the recursive that does not work:

Select TYPE=dirs PATTERN *
Rename TYPE=dirs REGEXP PATTERN (.*) TO "{dlgstring} - \1" RECURSE

Thanks,

Dave

As I recall the recurse in regards to the rename command, only applies to renaming files recursively, not subfolders. A way around it though, is to use your first button command code in a lister that's set to flat view/mixed mode.

Thanks! It works in flat, mixed mode but the folder pane does not show the renamed directories. I have noticed this before. Any way to force the Opus to refresh the directory and filenames? Any way to make it do it automatically?

Sounds like a bug if it isn't updating automatically but you can do a manual refresh of the tree using

Go REFRESH=tree

or refresh the tree and source folder with

Go REFRESH=source,tree

or refresh everything that can be refreshed within the active window with

Go REFRESH=all

Your suggestion worked on the go REFRESH.

I am running XP64, maybe that is interfering with the automatic refresh.

That's possible. Does the tree refresh properly if you do a normal F2 rename on a folder?

F2 does nothing on my Opus, but if I select and right-click, rename folder then the folder pane does refresh to the new name.

Did you change/remove the F2 hotkey? If so fine but if not then that sounds wrong as well.

I had the Function Lock key pressed accidently and so F2 was actually mapped to Undo. Now when I rename with F2 the folder pane refreshes properly. Still though when I rename a flat directory, the only folders that refresh properly are the ones at the top level of the rename. All other sub-folders do not refresh in the folder pane.

Grrrrrrr F-Lock - the bane of my existence...

Completely useless - at least newer keyboards remember the setting between reboots - I'd much prefer they got rid of the whole idea. There's little chance of a decent MS or Logitech keyboard without it though :frowning: