Change font size for system and Keyboard Maestro

Hi all,

While working on my computer, I frequently change from sitting to standing. I would like to change the font size to a legible size for macOS and within Keyboard Maestro.

I used an AI tool to help me with an AppleScript to achieve this. It suggested:

tell application "System Events"
tell appearance preferences
set font size to 14
end tell
end tell

It did not work. I received an error:

Macro Cancelled
Execute an AppleScript failed with script error: text-script:77:86: script error: A property can't go after this property.
(-2740). Macro "System Font 14" cancelled (while executing Execute AppleScript).

I web searched this error. Results did not appear useful.

I found these threads which did not lead me to a solution:

This is too narrow in focus.

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application "System Events" to set frontApp to name of first process whose frontmost is true

tell application "System Events"
tell application process frontApp
tell window "Fonts"
tell splitter group 1
tell group 1
tell text field 1
set value to "18"
confirm
end tell
end tell
end tell
end tell
end tell
end tell

This fails as well.

Could someone help guide me towards a solution?

Any and all help is greatly appreciated. Thank you!