There's only one setting for Natural Scrolling in macOS. On the surface there are two (one for Trackpad and one for Mouse) but changing one changes the other.
I like to have Natural Scrolling on for Trackpad and off for Mouse. This is where this script comes in handy.
Tested on Sonoma. Tried a bunch of different scripts but this is the one that worked so I've put it here.
- Open script in Script Editor.
- File -> Export... as an application in Applications (choose whatever name you like).
- In System Settings on to "Privacy & Security" and add the new application in "Accessibility" section.
Now you can run this application and it will toggle the Natural Scrolling setting in Trackpad System Settings.