Page 1 of 1

How to rename current folder?

Posted: 28 May 2014 20:13
by Papoulka
OK - another scarcely-believable noob question. I have again spent well over an hour searching every part of the Scripting Help, and every scripting post that mentions "rename", and I am still baffled. It just can't be this hard...

--> How do I rename the folder currently selected in the tree?

I have both the Tree and a Pane open. I have switched Focus to the Tree (T), where the current folder is highlighted. I want to rename the folder to "Junk". But nothing I can find will do this. Everything seems to work on the contents of a folder (in the Pane).

Maybe I could copy the existing name, go up one folder, and do some kind of search & replace - but surely there is an easier way?

Thanks for any help -

Re: How to rename current folder?

Posted: 28 May 2014 20:33
by Marco
Assuming that when you select a folder in the Tree you automatically browse to it (that's not 100% given, I'm sure there's a way to override such behavior), this works

Code: Select all

rename, "Junk", , <curpath>;

Re: How to rename current folder?

Posted: 28 May 2014 22:15
by Papoulka
Thank you, Marco! That works fine for me. I don't think I'll have a problem with <curpath> unexpectedly changing, in my simple usage.

I'd suggest that this should be an example in the Help file entry for "rename".