How can I make a script to change Fn key as standard function key and make the command key behave as option key?

Using Shortcuts on Mac I made an AppleScript.

It opens keyboard settings only, and I don’t know how to continue. This is the code:

tell application "System Settings"
   activate
   reveal pane id "com.apple.Keyboard-Settings.extension"
end tell

There’s a free app called Karabiner Elements that can do this. You can also reassign just the right side modifier keys You could probably change profiles in Karabiner using AppleScript ui scripting

I don’t know if this factors into it but I think command left and right share the same key code, so not sure if it works with command but option and shift left and right have their own individual key codes) to be honest I don’t know if key codes are assigned to characters or mapped to the physical location on the keyboard. Anyway, I’ve only used it to convert the caps lock into shift, control, option command, down but I’m pretty certain karabiner allows for full customisation of all buttons.