Update
Based on a suggestion from @ccstone, this macro has been reworked, even before I finished documenting the first version. The version in this thread works, if you want to try it as is, but it uses Execute Shell Script in places where there are KBM actions to do the same task, making it harder to modify. The updated, simpler, all KBM version is being posted to the Macro Library section of this Forum as
I've been working on a Keyboard Maestro way to change margins in TextEdit. It's a work in progress so there are several things that I'd like to have it in that I haven't implemented yet, but in its current form, I'm finding it pretty useful.
I'll come back and explain this in much more detail. Unfortunately, I don't know how to save a draft that isn't public.
=TextEdit Macros Macros.kmmacros (133 KB)
The core of the edit is in the M05 macro:
There are two enhancements that I want to make, which I haven't started but which would make the user experience a bit smoother.
The first, simplest, is to replace the last macro in the series, M06, with one which automatically clicks the Revert button instead of instructing the user to do so. Simple in KBM, I just haven't gotten to it.
The other is to have a better interface for setting the desired margins instead of the current M04. Right now it's just a Prompt With List that currently has eight simple choices. I imagine this would be an HTML Prompt that would show the current values in the file and give you a chance to edit them individually, change units between TE's half-point scale to points, inches, centimeters, etc.