Not sure if this is useful but the following macro beautifies all files in a project. You could adapt it to beautify all open files.
_command void xbeautify_project(boolean ask = true, boolean no_preview = false, boolean autosave = true) name_info(',')
{
_str files_to_beautify [];
//_GetWorkspaceFiles(_workspace_filename, files_to_beautify);
_getProjectFiles( _workspace_filename, _project_get_filename(), files_to_beautify, 1);
if (ask && !no_preview) {
activate_preview();
}
int k;
for (k = 0; k < files_to_beautify._length(); ++k) {
if (ask) {
if (!no_preview) {
struct VS_TAG_BROWSE_INFO cm;
tag_browse_info_init(cm);
cm.member_name = files_to_beautify[k];
cm.file_name = files_to_beautify[k];
cm.line_no = 1;
cb_refresh_output_tab(cm, true, false, false);
_UpdateTagWindowDelayed(cm, 0);
}
_str res = _message_box("Beautify " :+ files_to_beautify[k], "Beautify project", MB_YESNOCANCEL|IDYESTOALL);
if (res == IDCANCEL) return;
if (res == IDNO) continue;
if (res == IDYESTOALL) ask = false;
}
if (edit("+B " :+ files_to_beautify[k]) == 0) {
beautify();
if (autosave) save();
}
else
{
edit(files_to_beautify[k]);
beautify();
if (autosave) save();
quit();
}
}
}