Create multiple files based on one input name

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}.h" MAKEVISIBLE=immediate DESELECTNOMATCH
Select EXACT PATTERN="{$basename}.cpp" MAKEVISIBLE=immediate

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

2 Likes