The Keyboard Maestro macro Textcavator 2021 does that, Riccardo.
For more information, see the wiki Searching the Forum for Answers section.