Create multiple files based on one input name

I'd like to create an .h and .cpp file using one command. So that I input a name once and a "MyFileName.h" and "MyFileName.cpp" will be created
I tried
FileType NEW=.txt NEWNAME="empty."
FileType NEW=.txt NEWNAME="empty."
that creates one file, let's me input a name and creates another file and let's me input the name but that's not that much of an improvement.

I'm sorry I cannot help you with your issue, but I can welcome you to our forum :smiley:

So welcome, BoomRaccoon!

1 Like

This will ask for a name, create a .cpp and .h file, scroll both into view and select them (deselecting anything that was selected before):

@set basename={dlgstring|Enter name for .cpp and .h files:}
FileType NEW=.txt NEWNAME="norename:{$basename}.cpp"
FileType NEW=.txt NEWNAME="norename:{$basename}.h"
Select EXACT PATTERN="{$basename}.cpp" MAKEVISIBLE=immediate

If needed: How to use buttons and scripts from this forum


Thanks a lot :grinning:

What are some resources to get started writing these kind of commands? My guess is that the main ones are!Documents/Command_Reference.htm!Documents/Internal_Commands.htm
but you might have some more goodies you could add to your post

Those are the best places to start.