This is kind of awesome. Like the old Apollo OS, whose windows could be completely controlled by the commandline. Like a modern haiku:
qdbus | grep kate | while read k; do qdbus $k | grep save_all | while read i; do qdbus $k $i trigger; done; done