New Folder (2) numbering from button


If i create a new folder by a button (CreateFolder "NewFolder"), by pressing it again, it doesnt create "NewFolder (2)" like in explorer. If i do the same but with creating files, DO creates "newfile (2), newfile (3)" like in explorer. There are cases, where its more simple to just create a bunch of empty folders and files and rename them later. Is this intentional?


Luckily, yes. Simply use CreateFolder on its own to create the folders. Use the FileType command, if you need more control over names, types, and count of created items.

These are the commands I use for create folder and text files and you can repeatedly click them to create a bunch of folders/files. The timestamps are poor man's versioning system for me, but you can use your own pattern obviously.

CreateFolder INLINE Name=New-%COMPUTERNAME%-{date|yyyyMMdd}-{time|HHmmss}
FileType NEW=.txt NEWNAME=Text-{date|yyyyMMdd}-{time|HHmmss}.txt

If you just run CreateFolder or CreateFolder INLINE on their own, it will use New Folder, New Folder (2), etc. as the names automatically based on what already exists in the folder. (You also get the chance to type a different name if you want something different, but can just push return or, in the inline case, click somewhere else to use the default name.)

(The inline version is like what File Explorer does, and like when creating a new text file. The non-inline version opens a dialog. But both choose the default folder name in the same way.)

Yes, in that if you explicitly tell the command to create a folder named "NewFolder" by running CreateFolder NAME="NewFolder" then it's going to use that name.

(If the folder already exists when you specify a name explicitly, nothing happens. That lets you have buttons that can create folders if they don't exist, and then do things with them, without having to worry about creating a mess or seeing error messages if the folder already exists.)

But if you don't specify a name and let the command come up with one for you, the behavior is similar to Explorer.

I do the same sometimes. We included something similar in the default toolbars:

2021-10-22 14-25-09 Clipboard Image

1 Like

Thank you for all the answers!

@lxp Thx im using the filetype for files, works good. Now using filetype for folders too, but its creating the folders more slowly. Numbering works as i expect.

@cyilmaz Yeah i use dated names also. @lxp has a good script for them.

@Leo Okay i understand the "limitation" i will live with it. Wanted to avoid being in rename mode but maybe i will use CreateFolder instead of FileType because its quicker to just burst out 3 or 4 new folders.

Thx everyone!