Next: , Previous: Chaining commands, Up: Executing external tools


16.6.4.2 Saving open windows

Before launching the external tool, you might want to force GPS to save all open files, the project...; This is done using the same command GPS itself uses before starting a compilation. This command is called MDI.save_all, and takes one optional boolean argument which specifies whether an interactive dialog should be displayed for the user.

Since this command aborts when the user presses cancel, you can simply put it in its own <shell> command, as in:

     <?xml version="1.0" ?>
     <save_children>
       <action name="test save children">
         <shell>MDI.save_all 0</shell>
         <external>echo Run unless Cancel was pressed</external>
       </action>
     </save_children>