Use File Watcher plugin for that (should be bundled since v7 by default) -- this way such script will be run on each of desired modified files on save automatically.
Alternatively you can use External Tools functionality and invoke it manually when desired.