The IbmEditorFamily of TextEditors has a history of using RexxLanguage and using it in a very particular way. Macros are sequences of built-in TextEditor commands (since all such editors have a CommandLine) surrounded by RexxLanguage control structures (IF-THEN-ELSE, DO-WHILE, etc.) and data structures (variables and stems).
Since REXX is designed to 'address' a specific command line interpreter, it sends all non-built-in commands to the command line interpreter.
This is the normal REXX way of doing things. In fact, the SUBCOM sub-command environment is a VM/CMS way of doing things that is explicitly available via REXX.
Integration toolkits are more sophisticated.
Sun had a system called ToolTalk which seemed to have a similar ambition.
Apple still supports an integration technology called AppleScript which allows for an object-oriented view of scripting application objects.
In the ACME and sam editors, the plugin doesn't really exist. Instead, the selected text becomes input to a standard unix command. The stdout forms the replacement string. Many other editors have this capability