Automatically save when running command

I have created a few commands to run make with various options. It would be nice to automatically save either all files before the command is executed.

Is there a way to write a macro to do this (onRunCommand or something)?

Otherwise, it would be nice if it was available as an option in the Command properties in future.

You can write a macro to automatically saves all files by running the cmd_saveAll command and use cmd_toolsRunCommand to run your custom Command in Toolbox? (@nathanr can you explain this?).
Read more about running commands in macros here:

Right, you can execute the cmd_saveAll command like this:


Hmmm… Thanks. But there doesn’t seem to be a way to tell cmd_toolsRunCommand which command to run. So this ends up requiring more keystrokes than just remembering to hit Save or SaveAll before running the command!

I suppose I could use runEncodedCommand to run make, though. I’ll try that.