All commands of UltraEdit which open a dialog for the user to choose settings are not available as macro or scripting command with the exception of sort, find, replace, find in files and replace in files.
However, Artistic Style is just an executable installed with UltraEdit in subdirectory GNU. So it is possible to configure a user tool or a project tool to run Artistic Style on active file using as command line:
"UltraEdit program files directory\GNU\astyle.exe" options "%f"
The options to use can be seen in Artistic Style Formatter dialog. They can be also stored in an options file and this options file is specified on command line.
UltraEdit prepends additionally the options --ascii and -sX for default indent width whereby X specifies the number of spaces configured for active file type according to tab stop / indent value setting.
astyle.exe can be run with command line option --help in a command prompt window or from within UltraEdit via Advanced - DOS Command to get help.
The macro can run the configured user or project tool and then runs the Perl regular expression on reloaded file reformatted by Artistic Style.
It is of course also possible to output reformatted contents to console captured by UltraEdit to a new file, making the replaces on this new file, copying the reformatted contents to clipboard, closing new file containing captured output without saving, and pasting reformatted code over original file contents selected before. That would be perhaps better as it makes it possible to undo the changes by using Undo command to undo the paste over entire selected file contents.
Let me know if you need more help on configuring user tool running astyle.exe and UltraEdit macro to run this tool and correct wrong inserted spaces.
Best regards from an UC/UE/UES for Windows user from Austria