**Background**
When menu bar items are rearranged manually using Cmd+drag, macOS writes a new "preferred position" preference to each app that is showing a menu bar icon. (This preference helps, but does not guarantee, that they retain their position for subsequent launches.)

**Problem**
I want to automate the saving of the menu bar icon positions, without interacting manually, for educational and accessibility reasons.

**Question**
How can I automate the repositioning of a menu bar item (which will trigger the system to write the new prefs)?

Or, how can I trigger macOS to write the new preferences directly (without automating a repositioning of a menu bar item)?

*I do not want to interact with the menu items manually, or write out the preferences myself.*