Creating multiple files using the 'new item' menu

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
roel_v
Posts: 24
Joined: 13 Jul 2014 12:39

Creating multiple files using the 'new item' menu

Post by roel_v »

I have some templates for C++ classes (one .h and one .cpp file) for which I now have custom Visual Studio wizards. But they're a pain to maintain so I'd prefer to replace them with XYplorer scripts somehow.

What I need: when I click somewhere, I need to enter the class name, and then two files should be copied from a well-known directory into the current XYplorer directory. It should do a search/replace within the new files, and replace a well-known placeholder value with the class name I just entered.

What is the easiest way to go about this?

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Creating multiple files using the 'new item' menu

Post by highend »

Not possible via "new item" menu

Write a script and put that in a catalog entry, in a popup menu, toolbar button and / or assign it to a keyboard shortcut...
One of my scripts helped you out? Please donate via Paypal

roel_v
Posts: 24
Joined: 13 Jul 2014 12:39

Re: Creating multiple files using the 'new item' menu

Post by roel_v »

OK thanks - is there a way to do search/replace in XYplorer script, or do I just revert to batch files?

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Creating multiple files using the 'new item' menu

Post by highend »

Directly in a file without reading it's content first? No.

Script commands: replace / replacelist / regexreplace are your options

To efficiently replace content in files without reading their content,
I personally use https://sites.google.com/site/regexreplace/
(e.g. from XY scripts as well)
One of my scripts helped you out? Please donate via Paypal

highend
Posts: 13313
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Creating multiple files using the 'new item' menu

Post by highend »

And?
One of my scripts helped you out? Please donate via Paypal

Post Reply